Rails Actionmailer Send email to all users EXCEPT - email

Right now I have a really simple mailer:
class ExampleMailer < ActionMailer::Base
default from: "info#example.com"
def weekly(email)
mail to: email, subject: "500 Points for liquid.radio!"
end
end
What I really want to do is send an email to all Users. The problem is that, a while back, there was a problem getting the email addresses from the facebook users, so as a temporary solution I generated a generic "xxxxxxx#facebook.com" email address for each user that wasn't able to get it from omni-auth.
So now what I would like to do is email all users EXCEPT for the ones with the "#facebook.com" email address.
Once that's setup I usually send the emails from the console like this:
ExampleMailer.weekly("example#gmail.com").deliver
I would imagine I'll have to find a different way to do that if I'm going to email all the users (except for the facebook ones.)

Related

How can i create an email server that recieve mails without existing user accounts?

i have an email domain but i want to create an email server using that email domain but these server should be able to recieve emails and handle them without existing user accounts.
I mean, if someone send an email like "aaa#mydomain.com" or "bbb#mydomain.com" the server should be able to recieve those emails and handled them but those user accounts (aaa or bbb or other any "users") don't really exist in my email server.
I don't know if i have to program from zero an email server that should be able to do that (I use Java) or if there's email servers out there that can do what i want to do.
Thanks in advance.

Handling Incorrect Emails

Let's say my domain name is faketests.com (it's not) but people keep emailing various users at #faketest.com email addresses. If I own both the faketests.com and faketest.com domains, how do I make it so that when someone emails anyone #faketest.com it automatically sends that email to the same user #faketests.com?

Getting a List of My Email Recipients who have viewed my email?

Trying to get a list of my email recipients who have seen my email, and then to use a different medium to address who didn't see (via SMS/Call).
I could get the number of people who saw the email by having a hit counter set up in a web server, looking for a method to get this done now. Any help?
Thanks.
It can't be done reliably. Popular email clients will not do anything to alert the sender that an email was received because this allows spammers to detect if the email address is valid. That's why most email clients block remote images until the user clicks "Show Images" because the images could be used for this purpose.
Email system support something called a "read receipt" that is intended for this use but most clients will never send one.
You can detect if an email bounces but receiving an email and viewing an email are two different things.

How do I build a notification email/reply system like Facebook?

When users receive a notification email about a new private message on Facebook, they can reply to the email and have their response automatically added to the conversation on the site.
How can I build a cross platform system like that? I'm building a group chat system.
This is obviously way over-simplified, but here we go:
The way Facebook's emails work is by using a string that's unique to the receiver in the reply-to address:
<m+50edqb50000003jtdj389k6xib6hofj6t41q1c45sdt92qc#reply.facebook.com>
So when Facebook receive an email into reply.facebook.com, they (presumably) parse the string after the plus sign, decide which user/conversation it's relevant to, and add the text of the email into that conversation.
One option:
Send every notification email with a unique reply-to address, then receive replies with a customized SMTP server that will pair responses with the originating message object in your DB.
Since you are using django (according to your tags) I would recommend looking at the Lamson python SMTP server. It can be programmed to correctly attribute each message. Using Lamson with Django is documented.

Facebook proxy email not arriving -- do I need permissions?

I'm building a website that allows user to connect using Facebook Connect. So far I'm able to log the user in and fetch data about them (name, email, pic, etc.). If I fetch the email (using Users.getInfo) I get a proxied email (apps+blahblah#facebook.com), which is absolutely great. Problem is, that email doesn't work. I've tried sending an email to it and I never received it. There are two reasons I see that could cause this:
I don't have enough permissions. Ok, I can understand that, but if I don't have enough permissions then why are they returning an email at all?
The email has to be somehow sent from the application itself (I've tried sending it from my Gmail account) -- but how would Facebook know that the email is coming from the application?
So which is it? Or is it something else?
I have recently been looking into this as well.
I did find some guidelines on http://www.insidefacebook.com/2010/01/15/facebook-platform-email-sharing-api-proxy-email-service-going-live-in-5-days/
here is the most important part:
Emails you send must clearly indicate that they are from you and must not appear to be from Facebook or anyone else. For example, you must not include Facebook logos or brand assets in your emails, and you must not mention Facebook in the subject line, “from” line, or body header. All emails to users must originate from the same domain, and you must provide us with the name of that domain in the Facebook Developer application used to manage your application.
I have already found that if you do not have the address in the from as #facebookappmail.com
might even have to be appname#facebookappmail.com the emails will bounce. So sending from your gmail will not work, the "blah blah blah" in the proxy contains the application information of the application that had the permissions to get that email.