Hi,
We send out order confirmations and order ready at pick up location.
We don't have the pick up location address en name available in the order ready at pick up location event, so what we do is this:
In the order event, we write the pick up location to the profile and in the ready at pick up location e-mail we retrieve those fields from the profile to show them in the e-mail.
It looks like this for the company name:
{% let igCompany = "" %}
{%#if contains(profile._clientname.igOrderEventsCollection, context.journey.events.`1154443460`._clientname.igOrder.igUid, false) %}
{% let igCompany = regexGroup(profile._clientname.igOrderEventsCollection,concat(context.journey.events.`1154443460`._clientname.igOrder.igUid,"\\.igHomeDeliveryAddress.igCompany=(.*?);"),1) %}
{%/if%}
Then we can use the pick up location name in the e-mail as this: {{igCompany}}
But sometimes we have special order were we don't have a order event for, but we do get a ready at pickup location events.
We don't want to send out e-mail for those cases, since we don't have the pick up location details available.
So my question: how can we make a condition in the journey that checks if {{igCompany}} is empty? We probably do need to state the let statements too:
{% let igCompany = "" %}
{%#if contains(profile._clientname.igOrderEventsCollection, context.journey.events.`1154443460`._clientname.igOrder.igUid, false) %}
{% let igCompany = regexGroup(profile._clientname.igOrderEventsCollection,concat(context.journey.events.`1154443460`._clientname.igOrder.igUid,"\\.igHomeDeliveryAddress.igCompany=(.*?);"),1) %}
{%/if%}
Can someone help me?
Talitha
Solved! Go to Solution.
Views
Replies
Total Likes
Hello @Taal
If you do not want to send an email in this case then you can use the condition in the journey.
Something like this:
If you do not want to print the company name then you can use a condition like this.
{%#if isNotEmpty(companyId)%}
print company name
{%/if%}
Views
Replies
Total Likes
Hi Manoj,
Thanks for your reply.
The first option is impossible since I can only use the field in the advanced expression.
The second option isn't possible either, since I don't want to send the e-mail at all if no company name is available.
Views
Replies
Total Likes
You can use also use isEmpty and isNotEmpty functions for validation. Both are available in advanced expressions
how can we check the Isempty with date field as i am getting syntax error?
Views
Replies
Total Likes
Views
Likes
Replies