Skip to Content

Send emails with customer-specific qr codes in Hybris Marketing

Hybris Marketing provides us an app to manage coupons. However, this does not completely fit our use case. We want to send emails with qr codes which are unique for each customer. I read that customer specific offers should come with an upcoming release, but I guess this will take some time.

So far I have found a simple solution (even though not very professional). When creating an email in Hybris Marketing's Content Studio, I simply use an external service along with personalization attributes. This looks somehow like that:

<p><img src="|%SOME PERSONALIZATION ATTRIBUTE LIKE BUSINESS PARTNER ID%|" alt="Event Ticket" title="Event Ticket" width="150" height="150" style="opacity: 1; width: 100px; height: 100px;" data-sap-hpa-ceimo-image="SMOImage" data-sap-hpa-ceimo-image-type="Static" data-sap-hpa-ceimo-image-id="15227541955311107"></p>

When I send this email, each recipient receives an individual qr code with their ID (or some other information). The whole thing should work like an invitation. At an event, the code should be easily scanned with a qr code scanner. The ID is read out and there follows a reaction. For the scanning functionality I use a custom Fiori application.

I wonder if there is an alternative solution for the qr code generation that does not make you dependent on an external service. The process should be kept simple. How could it look like? Thank you!

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    May 16, 2018 at 02:41 PM

    I have found a solution myself by customizing the adapter class CL_CUAN_MKT_EXEC_EXECUTE_EMAIL for email actions. You can easily define your email template in yMarketing. Just add a text qrcode somewhere in the template where you want to position the qr code.

    1. Create copy of the whole class CL_CUAN_MKT_EXEC_EXECUTE_EMAIL

    2. Determine the ID of the executing campaign in IF_CUAN_MKT_EXEC_EXECUTE_ACTN~PROCESS after personalization (me->personalize)

    lv_campaign_id = me->ms_mktorc_root-initiative_id.

    3. Add a new method add_qrcode after personalization which exports the campaign ID as well as lt_exec_member_status and changes lt_pers_content

    4. Build up the method add_qrcode and start with looping over ct_pers_content (lt_pers_content)

    5. Determine the member key of the actual recipient

    lv_member_key = <cs_pers_content>-tg_member_key.

    6. Do a read and find the actual member set in it_exec_member_status (lt_exec_member_status) which contains the contact key

    READ TABLE it_exec_member_status INTO wa_exec_member_status WITH KEY TG_MEMBER_KEY = lv_member_key.

    7. Build the html tag with external qr code generator API

    lv_qrcode = '<img src="' && iv_campaign_id && 'x' && wa_exec_member_status-CONTACT_KEY && '" width="100" height="100" style="opacity: 1;" data-sap-hpa-ceimo-image="SMOImage" data-sap-hpa-ceimo-image-type="Static">'.

    8. Get the html content for the actual recipient (already personalized but with missing qr code)

    lv_html = <cs_pers_content>-email_message_ref->if_cuan_mkt_exec_email~get_body_html( ).

    9. Replace all text in the template which says qrcode and add the real qr code image instead

    REPLACE ALL OCCURRENCES OF 'qrcode' IN lv_html WITH lv_qrcode.

    10. Correct the personalized content with the new html body

    <cs_pers_content>-email_message_ref->if_cuan_mkt_exec_email~set_body_html( lv_html ).

    11. Replace the standard adapter class for email actions in spro > SAP Hybris Marketing > Campaigns > Campaign > Define Campaign Categories and Actions with your custom class

    It's done! As a result, every email sent with yMarketing and containing text qrcode will have an qr code image with the campaign ID and the contact key as data.

    Hope this helps!

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Ubkcah,

      Thanks for your effort for the answer. As a general practice try not to replace or modify the SAP standard actions.

      You should create a new custom action(if not done) which should be copy of standard "Send Email" action and then assign your custom class to the custom can ensure for future release to use both custom send and standard send email actions if required and should not have any issues during upgrade as well as the standard may overwrite the SPRO entry.



  • Apr 09, 2018 at 10:03 AM

    Hello Mr. Ubkcah,

    As of now, SAP Hybris Marketing doesn't have QR code feature!

    Recommend you to submit your idea of improvement through the SAP Customer Influence Programs for "SAP Hybris Marketing Cloud" so that your idea could be evaluated there.

    Thank you.

    Best Regards,


    Add comment
    10|10000 characters needed characters exceeded

  • Apr 26, 2018 at 12:16 PM

    If not QR codes, is it possible to maintain multiple coupons per contact in hybris marketing? I imagine that I can create different coupon types in hybris marketing, but how can I maintain assignment of each to different contacts?

    For example, coupon 25USD value, coupon 50USD value, etc. One customer can have both, other can have two coupons of 25USD. Is this supported in standard? I cannot get that from the help page.


    Add comment
    10|10000 characters needed characters exceeded