Send a copy email to the submitter

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

      It would be good if we could opt to send a copy of the contact email to the submitter, so that they have a record of their input.

    • #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).

      • #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.

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