Forum Discussion
RickPutnam
5 years agoQrew Cadet
I have a partial solution which is to write:
That captures the first recipient -- and for my current use case, that's enough. However, I'd still be happy to hear solutions for capturing all the recipients.
Thanks.
------------------------------
Rick Putnam
------------------------------
{{a.to_recipients[0].email_address.name}}
That captures the first recipient -- and for my current use case, that's enough. However, I'd still be happy to hear solutions for capturing all the recipients.
Thanks.
------------------------------
Rick Putnam
------------------------------
- AngelRodriguez5 years agoQrew Assistant CaptainHi Rick,
I had the same issue, but I found that I could use a for loop using jinja templating to pass all of the recipients into one field.
Try this for loop:{% for email in a.to_recipients %}
{{email.email_address.name}},
{% endfor %}
The{% code here %}
is similar to how you would add JavaScript in Node.js, Python inside of Django html templates, Ruby inside of Ruby on Rails html templates, etc. The double curly braces represent the{{ variable }}
data you would like to pass into these templates. In our case, the object data in Outlook into our template.
Here,email
is your loop variable. This allows you to iterate through youra.to_recipients
array (or list in Python).
so you can prefixemail_address.name
with theemail
variable using dot notation and this gives you the valueindex[email]
inside of your for loop. This is the same as the value ofemail
froma.to_recipients[0]
,a.to_recipients[1]
,a.to_recipients[2]
, etc. in sequence until you reach the end of the array. Hope this helps!
I'm also adding a snapshot of what I put together in Pipelines to put this into context.
------------------------------
AR
------------------------------