Sales Email

DanteDee
Participant

Personalization Tokens - Line Items

SOLVE

Hello,

I am having trouble displaying personalization tokens for line items in our emails. When integrating a personalization token for a line item, the only value that appears is the default value (null in my case). 

 

It is odd because I am able to retrieve the correct information when using the personalization tokens for the deal. It just will not work for line items. Even though the line items is associated with the deal.

 

Am I missing something? A speedy response would be very helpful since my subscription is running up soon. I would like to publish my workflow before then so I can decide to re-subscribe again.

 

Thanks,

-Dante 

1 Accepted solution
DanteDee
Solution
Participant

Personalization Tokens - Line Items

SOLVE

@karstenkoehler 

 

I got the answer directtly from support! Personalization tokens are not supported when using standalone line items (no eccomerce connection). So if you created the line item manually the personalzation token will not work.

 

The only work around I found was to create a custom module and use HTML / HUBL code to display the line item properties.

 

Code used: 

{% email_each list="deal.line_items" item="line_item" %} /// THIS IS WHERE YOUR LINE ITEMS GO {% endemail_each %}

 

Thank you for all your help with this issue!

 

-Dante

View solution in original post

13 Replies 13
CMusella
Participant

Personalization Tokens - Line Items

SOLVE

@SleepyBoBos  can you share how to do that?

SleepyBoBos
Participant

Personalization Tokens - Line Items

SOLVE

Apologies, looks like I jumped the gun. When I looked into this further its just the ability to add line items from a cart and as long as you have Magento\Shopify etc

0 Upvotes
SleepyBoBos
Participant

Personalization Tokens - Line Items

SOLVE

Good news is looks like you can now add line items in via a widget when you create an email

0 Upvotes
DanteDee
Solution
Participant

Personalization Tokens - Line Items

SOLVE

@karstenkoehler 

 

I got the answer directtly from support! Personalization tokens are not supported when using standalone line items (no eccomerce connection). So if you created the line item manually the personalzation token will not work.

 

The only work around I found was to create a custom module and use HTML / HUBL code to display the line item properties.

 

Code used: 

{% email_each list="deal.line_items" item="line_item" %} /// THIS IS WHERE YOUR LINE ITEMS GO {% endemail_each %}

 

Thank you for all your help with this issue!

 

-Dante

AMorrissey00
Member

Personalization Tokens - Line Items

SOLVE

I can't get mine too appear i have like 173 line items 

0 Upvotes
DaveGoff2
Contributor

Personalization Tokens - Line Items

SOLVE

Hi DanteDee

This look like exactly what I need. Can you elaborate a bit on how you have this set up?

0 Upvotes
CMusella
Participant

Personalization Tokens - Line Items

SOLVE

This is great!  I'm just getting into HubSpot custom modules.  I  want to create a marketing email that triggers from a workflow to send.  I want it to include the line items from the deal.  Where would I use the snippet: {% email_each list="deal.line_items" item="line_item" %} /// THIS IS WHERE YOUR LINE ITEMS GO {% endemail_each %} 

 

Thanks for the help @DanteDee 

DanteDee
Participant

Personalization Tokens - Line Items

SOLVE

@CMusella 

 

I hope this helps @DaveGoff2 as well.

Sorry for the late reply.

 

It has been a long time since doing this project so forgive me if I am not all that helpful. In my example I created a "Line-Items in Email" module within the email template and then edited the code to display the items unique to the person receiving the email.

Here is what my email looked like:

Hubspot example.png

 

Here is how I achieved it:

<span style="font-family: Georgia; font-size: 14px;">
{% email_each list="deal.line_items" item="line_item" %}
{{ personalization_token('line_item.name', 'null') }} ... <small>x</small> {{personalization_token('line_item.quantity', '0')}} ... $ {{ personalization_token('line_item.price', 'null') }}
<br>
{% endemail_each %}</span>

 

I remeber having to use the Products & Qoutes functionality inorder to get that code working. Since the code used above is referencing the product line items. As you can see here I created two items in my product list.

 

Products.png

 

As for testing my code, I basically created a dummy "Contact" and assigned them one of the two products. Then when I sent out the email, it would populate based on which product I assigned to them.

 

Sorry, I wish I can remember more of how I acheived this. My best advice would be to get in contact with support thye were super helpful and turned my week long project into an hour long project.

 

Hoped this helps,

-Dante

DaveGoff2
Contributor

Personalization Tokens - Line Items

SOLVE
Got it, thanks for the reply!
 
I ended up finding some abandoned cart code that I'm modified and I think between what you provided, thanks again, and this, I'll be able to work it out. 🙂
 

 

    {% email_each list="deal.line_items" item="line_item" %}
        <table class="templateColumnWrapper" cellpadding="10" style="margin-top: 20px;">
            <tbody>
                <tr>
                    <td class="column" style="vertical-align: middle;">
                        <img src="{{line_item.ip__ecomm_bridge__product_image}}" width="130" style="max-width: 130px;">
                    </td>
                    <td class="column summary" style="vertical-align: top;">
                        {{ module.order_summary }}
                    </td>
                </tr>
            </tbody>
        </table>
    {% endemail_each %}

 

DanteDee
Participant

Personalization Tokens - Line Items

SOLVE

@karstenkoehler 

The workflow works perfectly fine. I am able to recieve the email with the personalization tokens but the line item personalization tokens are the defualt values. However, the deal personalization tokens are getting the correct information.

 

Here is the Email format:

InkedScreenshot 2021-01-29 111109_LI.jpg

 

Here is the Email I receive:

Screenshot 2021-01-29 111738.png

Here is the line item in this particular deal: 

Screenshot 2021-01-29 111834.png

 

It is quite odd why the deal personalization tokens work but the line items personalzation tokens do not.

Thanks,

-Dante

0 Upvotes
karstenkoehler
Hall of Famer | Partner
Hall of Famer | Partner

Personalization Tokens - Line Items

SOLVE

Hi @DanteDee,

 

In your test, is the email sent without the personalization token or is it not sent at all? Have you check the workflow history tab for any clues?

 

It's hard to tell without being able to access these assets – since you're on a Professional subscription, I'd recommend reaching out to HubSpot support. They can help identify the issue right in your portal.

 

Best regards!

Karsten Köhler
HubSpot Freelancer | RevOps & CRM Consultant | Community Hall of Famer

Beratungstermin mit Karsten vereinbaren

 

Did my post help answer your query? Help the community by marking it as a solution.

karstenkoehler
Hall of Famer | Partner
Hall of Famer | Partner

Personalization Tokens - Line Items

SOLVE

Hi @DanteDee,

 

Line item personalization tokens are only valid in deal-based workflow emails – could you confirm you're working on a deal-based workflow and not a contact-based workflow?

 

Hope this helps!

Karsten Köhler
HubSpot Freelancer | RevOps & CRM Consultant | Community Hall of Famer

Beratungstermin mit Karsten vereinbaren

 

Did my post help answer your query? Help the community by marking it as a solution.

DanteDee
Participant

Personalization Tokens - Line Items

SOLVE

@karstenkoehler ,

 

Here is my deal workflow for this deal stage. The email I am trying to add the line item personalization to is called "Abandon Cart - ABS". 

 

Screenshot 2021-01-29 083503.png

ABS - Deal workflow.png

 

Right now I have added two line items into the deal "Test - 4" as you can see below. "Test - 4" is using the deal workflow above and is in the "Checkout Stage - Shipping" stage.

 

InkedScreenshot 2021-01-29 083827_LI.jpg

0 Upvotes