Feature Requests
Share ideas, discuss and vote on requests from other users in community
 

Add more vars to EmailPreSend Hook

Shaun Reitan shared this idea 10 months ago
Under Consideration

I'd like to see a few more vars passed to this hook to make it more usable.

Add Email template type to the vars passed to this hook.

    add_hook('EmailPreSend', 1, function ($vars)

    {

    if ($vars['type'] == 'service') {

    return $extra_service_merge_fields

    }

    });

Even better would be to pass all template vars available to this email template to this hook

    add_hook('EmailPreSend', 1, function ($vars)

    {

    if ($vars['mergefields']['client_id'] == '1') {

    return $special_client_stuff;

    }

    });