HTML Email

Permalink Browser Info Environment
Hello,

We would like the facility to send out an email automatically with the voucher code but to have the option of adding HTML to the email.

While our main sales tool for gift vouchers will be the website our main method of accepting vouchers will be in paper form. We can print these ourselves but would like customers to have the option of printing a styled gift voucher and giving it to others without going through us.

Is this possible?

Thanks

Type: Discussion
Status: New
babymassagelab
View Replies:
babymassagelab replied on at Permalink Reply
babymassagelab
The alternative might be to have a special/encrypted link generated for each voucher purchase where the customer could click the link and then print the voucher from our website using the default styling.

Or possibly a PDF voucher template where customers could print the PDF and fill in their voucher code in pen inside a box.

Are any of these options possible?
Mainio replied on at Permalink Reply
Mainio
Hi,

Yes all of them are possible.

I'd personally suggest the email-approach, using the email delivery method and then auto-generating the PDF for the customer and attaching it as attachment to the email to be sent.

To do this, you'll need to add some custom logic to the "giftcard_order_delivery" email template. To do this, copy
/packages/core_commerce_gift_cards/mail/giftcard_order_delivery.php
to
/mail/giftcard_order_delivery.php

And then just start modifying the email template and add your custom magic.

Hope this helps you out!

Best,
Antti / Mainio
Mainio replied on at Permalink Reply
Mainio
One correction that I'd like to take back: actually just checked from the core, so if you want to add attachments to the mail, actually you'll need to customize the whole email delivery.

You could just grab to the event with handle "core_commerce_gift_card_ordered", and deliver the codes with your custom logic.

The event will get these parameters:
First parameter: $couponSetProduct (of type CoreCommercePaymentCouponSetProduct)
Second parameter: $coupon (of type CoreCommercePaymentCoupon)
Third parameter: $order (of type CoreCommerceOrder)

This should provide you all the data you need to build your custom logic.

Best,
Antti / Mainio
Mainio replied on at Permalink Reply
Mainio
And one possibility is also simply building your own delivery method for the gift card. This isn't documented anywhere but it's basically quite the same as e.g. building custom payment type.

You could take e.g. the "email" delivery method as a starting point from:
packages/core_commerce_gift_cards/models/core_commerce/payment/coupon/delivery/methods/email/

Depends very much on your preference.

Best,
Antti / Mainio
babymassagelab replied on at Permalink Reply
babymassagelab
Hello Antti/Mainio,

I've been thinking about this and I think a better solution might be to build a web facing voucher page that customers reach by clicking a link in the gift voucher. Something like:www.www.domain.com?vouchercode=123456...

It would be easier to hook into the database and pull out all the relevant info than try to attach something to the native email functions. This leads me to a question:

Is it possible to edit the text that Ecommerce Gift Cards sends/attaches to emails when automatic delivery is enabled? If so where can I find this??

Many thanks
Andy
Mainio replied on at Permalink Reply
Mainio
Hi,

It sure is, like with any email template you use with c5.

The email template can be found from the package directory in /mail/giftcard_order_delivery.php. You can override this normally like anything else in c5 in your root-level directories.


Best,
Antti / Mainio

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.