Add a filter for email message content

Viewing 1 reply thread
  • Author
    Posts
    • #33248
      Martin Taylor
      Participant

      It would be good if there was a filter for the email message content in pta-display-directory.php, so that we can customise the email before it’s sent.

      Something like:
      $email_message = apply_filters ('pta_md_message', $email_message, $form_data);

    • #33253
      Stephen Sherrard
      Keymaster

      Please look at the code for the wp_mail function, as that already includes a filter hook. My plugin uses the wp_mail function to actually send the email, so that filter hook is already there, and would be redundant to add another one.
      https://developer.wordpress.org/reference/functions/wp_mail/

      • #33256
        Martin Taylor
        Participant

        Thanks, Stephen. That makes sense, and it’s what I’ll do.

Viewing 1 reply thread
  • You must be logged in to reply to this topic.