Set Email Name for SMTP


(Manthan Mallikarjun) #1

Hello.

Some forums systems allow you to put a “name” when sending an email.

When Discourse sends an email, the “from” shows noreply@domain.com. It would be great if we could pass a name so it would be Doamin Notification as the name.


(Jeff Atwood) #2

It already does this, see examples posted here in the past…

From: How-To Geek Discussion digest <forum@howtogeek.com>

from: SmashMartian <no-reply@boingboing.net>

Reply-To: Norton Imperial Labs : Discussion digest <ry@n.rix.si>


(Michael Downey) #3

What do you have set for the site setting “notification email”? This is what should be appearing on notifications from Discourse.


(Manthan Mallikarjun) #4

Sorry. I double checked. The name says “contact”. The email is set to "contact@altcointalk.org". How can I make it so that the name says “Forum Notification” or something like that?


(Michael Downey) #5

From what I have seen and recall, most notifications will take the form:

 From: "username" <discourse@example.com>

Where username is the short username (e.g. nahtnam) of the person who generated the content that created the notification, and where discourse@example.com is what you specified in the notification_email site setting.

Is this what you’re seeing? If so, things are working as intended.

Personally, I can’t stand this because it breaks e-mail standard conventions of having someone’s actual name in that field, as you say. But it’s pretty clear the designers disagree with me. :slight_smile:


(Manthan Mallikarjun) #6

Yep, but for things like reset password and confirmation emails the name just shows up as “contact” (if the email is set to contact@domain.com). Is there a way to change that?


(Michael Downey) #7

Right. Most email clients will default to just the part before the @example.com if there’s not a name specified like "My Discourse Site" <discourse@example.com>.

I agree, it’d be a lot nicer if the system allowed the From: field to use the Site Name here for non-notification emails.


(Jeff Atwood) #8

@neil can you double check here and make sure we’re using the email_site_title setting as appropriate on reset password and confirmation emails?


(Neil Lalonde) #9

It wasn’t, but I just changed it so it does. So @nahtnam, get the latest code and you’ll be able to set email_site_title to change that behaviour.


(Jeff Atwood) #10

And even if you don’t use email_site_title it should respect the regular site name, yes? The email_site_title is the special “I have a crazy site name so I need another name that’s shorter and not crazy to use in emails” name.


(Manthan Mallikarjun) #11

It doesnt use the site name. My site name is not set to “contact”


(TheLoneCuber) #12

Is there any way to remove the surrounding brackets from [email_prefix] so it’s just email_prefix?


#13

Is there a way to do this - remove the brackets from the email subject? Thanks