• Resolved ironfish2

    (@ironfish2)


    Hello,

    At:

    https://docs.themeisle.com/article/663-what-actions-and-filters-are-available-in-pirate-forms

    You list some actions you have developed.

    However, there do not seem to be any instructions around how to use these actions.

    I would like to change the destination/recipient email address.

    Not knowing where to add this code, or how it works, I just tried.

    For example, if I copy:

    do_action( ‘pirate_forms_before_sending’, ‘[email protected]’, $subject, $body, $headers, $attachments );

    Into my theme’s functions.php file, this does not work – ie it does not change the recipient email address.

    Any help would be very much appreciated.

    If this is a premium feature, please let me know.

    Thanks ahead of time.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hey @ironfish2,

    Can you tell me what you would like to accomplish in order to help you out. Actions are more used for running a routine in that specific place, not altering values.

    Thanks !

    Thread Starter ironfish2

    (@ironfish2)

    Hi, I will have a form attached to a custom post type template, and one field in each entry of the custom post type will contain a unique email address that should be the recipient for the form contents to be emailed to.

    So for each sending of a form contents, I need to get the email address from the custom field, and set the recipients of the emailed form contents to this address (programmatically).

    For this to be possible, the post id of the custom post type entry needs to be available in the form’s action/filter/hook.

    Thanks!

    • This reply was modified 7 years, 2 months ago by ironfish2.

    Ah, for the moment this is not possible as you can not change recipient email using filter. The piece of code you outlined allows you to hook to that specific moment, before sending the email.

    You can however hook to that action and do your own routine for mailing.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to use actions’ is closed to new replies.