catch an email with specific subject

  • Unknown's avatar

    Whenever WP sends out a mail, I want to check the subject variable of that mail and when it matches e.g. the string ‘abc’ then I want to send out a duplicate (cc) to another email. So in the event that ‘abc’ is the subject, then I want to add a cc with an extra email address. How can this be done in e.g. the functions.php?

  • Hi there,

    This is a question for the WordPress.org community at https://wordpress.org/support/forums/. They provide support for the open source WordPress software you’re using.

    The forum you’re posting in now is for the hosting provider, WordPress.com.

    That said, have you considered just doing this with a filter in your email account itself? You can create a filter to forward the email if it matches certain criteria, which would have the same end result as your site directly cc’ing the other email.

  • Unknown's avatar

    Thanks for the info. No that can’t be done on the mail account itself. It is the message that is sent to the customer (of placing his order) that needs to be copied. We also get a message, but that is different than what is sent to the customer. You see?

  • OK. This would likely be a setting in your plugin, or perhaps could be added as an extension to it.

    So I’d recommend posting in that plugin’s forum, or searching it to see if someone already shared a recommendation.

    Hoping this helps!

  • Unknown's avatar
  • The topic ‘catch an email with specific subject’ is closed to new replies.