Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
good to have this module, but i want to send more types of messages.
message types should be addable via the ui.
and possible to send them via rules.
Comment | File | Size | Author |
---|---|---|---|
#13 | Screen Shot 2014-11-17 at 10.05.07 AM.png | 39.96 KB | TravisJohnston |
Comments
Comment #1
agf1583 CreditAttribution: agf1583 commentedBump.
It would be very useful to have multiple templates, then be able to choose which template to use when setting up the rule.
Comment #2
zmove CreditAttribution: zmove commentedSubscribe
Comment #3
jsheffers CreditAttribution: jsheffers commentedThis is imperative. I want to send two separate emails depending on what product types are in the cart.
Comment #4
TaraRowell CreditAttribution: TaraRowell commentedYou can extend the template types via code...
I believe you must have these dependencies in your .info file:
dependencies[] = variable_email
dependencies[] = commerce_email
Comment #5
TravisJohnston CreditAttribution: TravisJohnston commentedHello Tara,
Thank you. Just to be clear, is the [mail_part] and MYMODULE the only sections that need to be changed, or does custom_name also need to be changed to something else?
Comment #6
TaraRowell CreditAttribution: TaraRowell commentedHi Travis,
Yes - you can make as many extra templates as you want but changing custom_name to whatever you want to name your template.
Actually, I'm not sure you even have to edit the [mail_part] text. I think it will display as HTML in the UI - you'll just have to experiment.
Comment #7
TravisJohnston CreditAttribution: TravisJohnston commentedAwesome, Thanks Tara! Worked like a charm!
Comment #8
Summit CreditAttribution: Summit commentedHi Travis,
May be good to also place your email template here, so people can copy-paste your work?
Thanks in advance if you are willing to.
greetings, Martijn
Comment #9
TravisJohnston CreditAttribution: TravisJohnston commentedSure thing.
So I have the need to have a separate email template for orders that contain regular products versus registration products since they will contain different information in the body. I have custom module called "ces_custom" and this code was placed into it's .module file.
Comment #10
nelslynn CreditAttribution: nelslynn commentedIt would also be great if you could create a template with different line items, for example I'm trying to create a packing slip that does not include pricing or line item totals. There is a packing slip module, but it's not set up via a rule to be send automatically after order placement.
Any ideas how I go about this?
Comment #11
TravisJohnston CreditAttribution: TravisJohnston commentedHi nelslynn,
I found that a lot of the included tokens didn't include the proper information or the format that I wanted. I ended up using the Token Embed Views module instead. This allowed me to create a view display that displayed all the correct information I wanted and then embed the view results inside of the email body using a custom token.
Comment #12
SurajHo CreditAttribution: SurajHo commentedHi Travis,
I was curious about how you used Token Embed Views in Commerce Email. I have created a view that will use the order-id as an argument. When I use the token to call this view in the confirmation email, it works when I put in a particular order-id. But I don't know how to put the order-id that comes with the confirmation email. Just for fun I tried to use [views:embed:view-name:display-id:[commerce-order:order-id]] but that obviously did not work. Could you tell me how you used Token Embed Views?
Regards,
Suraj
Comment #13
TravisJohnston CreditAttribution: TravisJohnston commentedHey SurajHo,
I attached an image of the relations I use. I do not supply a specific order ID, but that probably wouldn't hurt. At the moment, my view pulls in the latest order information based on ID. Since the email is generated immediately, it snags the output of the view and embeds it in the email. This has worked great for me since it has yet (and hopefully never) to happen when 2 orders are completed at the exact same time.
Your approach sounds like a better way to remove any chance of a order id mixup, but I don't think it's working because the context filters aren't being passed back to the view in time.
Comment #14
SurajHo CreditAttribution: SurajHo commentedHi Travis,
Sorry for the late reply. I hadn't subscribed to this issue. Thanks for supplying your setup of the view. I'm going to try this out and see how it works. And indeed, hoping that completing 2 orders at the exact same time won't occur. I currently use PHP code in the e-mail with the PHP filter, which works great, but I'm not very fond of making the PHP filter available at all.
Gr,
Suraj
Comment #15
rszrama CreditAttribution: rszrama at Centarro commented