Posted: November 5, 2013 at 2:01 pm
|
Hi All, I just had a request to send registrants an email registration based on the category of the event that they choose… is this possible through custom code? If so where would I start? Basically I am looking for conditional confirmation emails. |
Hi Deborah, At this time Event Espresso doesn’t have this feature, but it does allow you to select from pre-defined custom emails that are set up in the Email manager. |
|
|
Hmm is there any actions or hook in to the emailing process? It really needs to be specific to an event category, not the event itself. Say I have 3 events. Two are in the same category, and one is in another. The two with the same category should receive one confirmation and the other should get a different confirmation. I suppose its very specific to this case so it’s a little hard to explain. The categories actually become part of my registration form, and the user chooses one (there could be up to 30 or more choices) from a select field. I need the confirmation to be sent based on that fields value. |
|
Hi Deborah, The only hook I’m aware of is the email after payment hook – https://eventespresso.com/wiki/event-espresso-3-1-action-hooks/#action_hook_espresso_email_after_payment Depending on the gateway and EE version, this hook may solely be in the process_payments.php file, rather than the individual gateways. Filters: https://eventespresso.com/wiki/event-espresso-3-1-filters/ |
|
Hi Dean, I think what I really want to edit is in the function:
which is located in the includes/email.php file. The other hook doesn’t seem expose the data that I need to change, at least not in anyway that I’ve been able to test. Also my events are free, im not sure if that makes a difference. |
|
Hi, OK, if the hook I suggested isn’t suitable, the best I can do is make a request for an additional action hook in the espresso_prepare_email_data function, but I can’t guarantee if or when it would be added. Apart from that unless you modify core files (which we don’t recommend nor support) it may not be possible to do what you are looking to do. |
|
Hi Dean, Thanks, how can I make a feature request to add an action hook there? I would essentially need to grab the email content, add some text to it, then return the data back to the function to continue through the process. I think for now we can go without out it, but it would be a nice addition to the list of hooks if possible ๐ |
|
Hi, “Thanks, how can I make a feature request to add an action hook there? ” I’ve already done it, but as mentioned I can’t guarantee it will be added. |
Hi there, In this case you might not need a hook in espresso_prepare_email_data. What you can do is copy espresso_prepare_email_data into your custom plugin or into /wp-content/uploads/espresso/custom_functions.php and rename the function to something like my_custom_espresso_prepare_email_data. After that you may need to do the same thing if you’re relying on email_by_attendee_id. Then you can copy the entire event_espresso_email_confirmations function (it’s a pluggable function) to your custom functions file and change it so it calls your modified my_custom_email_by_attendee_id function. |
|
|
Hi Josh, Thanks, that seems like a good idea. I didn’t realize I could override those specific functions in my custom_functions.php file. I will try it out. Also thanks for submitting my feature request ๐ |
The support post ‘Custom Confirmation Email based on Category?’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.