WPPizza – A Restaurant Plugin for WordPress › Support › General Support › Email Template Question
- AuthorPosts
- 15 April, 2016 at 11:34 pm #17421
Is there a way to set up an email template that either has the Subject line or actual email message be JUST the email address from the order form after a user placing an order? I’m trying to connect mailchimp with emails from orders using Zapier, and I need either the Subject or Message of the email to be JUST the email address, with nothing else, in order for Zapier to process the email correctly.
16 April, 2016 at 1:51 am #17427there are 3 filters that work in conjunction (for details look at those inc/wppizza.send-emails.inc.php)
wppizza_filter_email_subject_prefix
wppizza_filter_email_subject
wppizza_filter_email_subject_suffixyou will probably want to filter by template id ($tpl_id)
this will be much more streamlined and less convoluted (like everything really) in v3.x when it comes out. for the moment, it is what it is
19 April, 2016 at 8:46 pm #17480Thanks for the info Olly.
I’m actually not sure how I’d go about using these filters in order to produce an email subject line that contains JUST the email address of the user. Any ideas as to how I’d go about using those filters to do that?
19 April, 2016 at 8:51 pm #17481add the email address to the subject line (in wppizza->ordrer form ) which adds the email to the “prefix”, and then just empty/unset the other two
20 April, 2016 at 9:42 pm #17515Hey Olly, thanks for the info.
I’m actually not sure how to go about emptying/unsetting the other 2 filters. In case I wasn’t clear, what I’m trying to do is build a new email that gets sent when a user places an order, so that the subject line contains JUST their email address, so Zapier can pull that email address and add it to Mailchimp.
So far I have the new email template created, but I’m trying to get the subject line OR the message for that email to be JUST the email address of the user. I’m getting the email to show up in the message of the email, but it contains additional code/text around, which isn’t gonna work.
How would I go about using these filters to accomplish that, where either the email message or subject line is JUSt the user’s email address?
20 April, 2016 at 10:05 pm #17517This reply has been marked as private.20 April, 2016 at 10:09 pm #17518I guess my question is, how would I go about using those filters you mentioned in order to have that email I created to send out JUST the user’s email address either in the subject or the message of the email? I’m not sure what the logic is behind those filters and what I actually need to do.
20 April, 2016 at 10:11 pm #17519you use filters to change what they return.
the subject line is made out of 3 parts (as mentioned) filterable by those 3 filters20 April, 2016 at 10:15 pm #17520Okay, so now that I have the email address from the user added to the email subject line from the Order Form, which gets placed in wppizza_filter_email_subject_prefix, I will need to create a function that filters by template id, to get the email template I created for this, then I unset the other 2 filters within the function?
20 April, 2016 at 10:34 pm #17521i think you need to learn how wordpress filters work.
you do not unset filters. you use filters (and their related functions) to change things as required based on the arguments passed20 April, 2016 at 10:41 pm #17522I’m just going by what you told me Olly, when you said to “just empty/unset the other two” in reply 17481. Again, what I’m trying to do is:
Build a new email that gets sent when a user places an order, so that the subject line contains JUST their email address, so Zapier can pull that email address and add it to Mailchimp.
I’ve checked on the option to add the email to the subject line in the Order From settings page, and you said that that would “add the email to the prefix”, and that I should then “just empty/unset the other two”.
Can you clarify what this means? I’ve worked with filters and such before, just never with WP Pizza, and I’m not finding any documentation that helps me do what I’m trying to do, which is why I’m asking for your support.
20 April, 2016 at 10:53 pm #17523> I’ve worked with filters and such before, just never with WP Pizza,
this has nothing to do with wppizza . filters work the same everywhere. wppizza or not.>and I’m not finding any documentation that helps me do what I’m trying to do
I gave you all you need.
the subject line is made up of three parts. all of which are filterable . (and the parameters passed to the filter in the file i mentioned near the beginning of this topic should be self-explanatory)i must admit, I do not know what more info it is you are looking for really.
20 April, 2016 at 10:57 pm #17524> the subject line is made up of three parts. all of which are filterable . (and the parameters passed to the filter in the file i mentioned near the beginning of this topic should be self-explanatory)
I’m not seeing a wppizza.send-emails.inc.php file in the inc directory, though I do see it in the classes directory (wppizza/classes/wppizza.send-emails.inc.php). Is that the same one you’re talking about?
20 April, 2016 at 11:22 pm #17525>Is that the same one you’re talking about?
yes.
- AuthorPosts
- The topic ‘Email Template Question’ is closed to new replies.