Martin Taylor

Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • in reply to: Send a copy email to the submitter #33258
    Martin Taylor
    Participant

    An alternative to my suggestion, based on the fact that Stephen’s plugin uses wp_mail, which itself uses PhpMailer.

    I’ve now found that it’s possible to set a callback function in PhpMailer. Its ‘action_function’ property can be used to set the name of a function to be called after the email is sent.

    I still feel that the ‘pta_member_contact_message_sent’ hook is in slightly the wrong place, but for now at least there’s another way to send an acknowledgement to the submitter.

    in reply to: Add a filter for email message content #33256
    Martin Taylor
    Participant

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

    in reply to: Send a copy email to the submitter #33252
    Martin Taylor
    Participant

    Since posting this suggestion, I’ve noticed that there is an action hook ‘pta_member_contact_message_sent’ which fires after the message is sent. That could perhaps be used, but the problem is that it’s fired even if the wp_mail function fails.

    What we need is for the do_action on this hook to be inside the success condition for wp_mail, or at least in a condition of its own, based on ($sent = true).

Viewing 3 posts - 1 through 3 (of 3 total)