Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm using the Mailchimp STS plugin for Wordpress, which uses Amazon SES for transactional emails. The plugin is set up correctly, but the default "From" name appears only as "andrew" in sent emails. Since there is no option to change this in the plugin's settings, I assume this is being grabbed from my email address (e.g. andrew@domain.com).

I found this code in the plugin:

// Plugin authors can override the potentially troublesome default
$phpmailer->From     = apply_filters( 'wp_mail_from', $from_email );
$phpmailer->FromName = apply_filters( 'wp_mail_from_name', $from_name  );

How can I change it so that I can display a custom "From" name (e.g. My Name, Company).

Thanks in advance for the help!

share|improve this question
add comment

2 Answers 2

There are two modes email can be sent with the plugin:

  • simple emails are sent through STS;
  • email with anything that STS doesn't support (custom headers, attachments, etc) are sent through fallback function, that is simply copy of native wp_mail() function.

For former plugin doesn't set from name at all. For latter it default to WordPress and goes through those filters you found.

Since neither fits your description I think it is simply email client, that you are checking this with, is taking part of email to show as (missing) name.

So this is not something you currently do, because wp_mail_from_name filter is not used by plugin's code. But it should be. I claim "it's beta" defence and off to create ticket so this is corrected in next version. Sorry for inconvenience!

share|improve this answer
add comment

I needed to do this too so I hacked it in. This code, which replaces the mailchimp-sts.php file, adds a field to the STS settings page where you can set a name to go in the from header.

http://pastebin.com/fMevKDdd

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.