It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

[Confiform] Email notification to specific users based on form input Edited

LostChild Jan 11, 2018

Hi there. I am new here!

This is my question: Email notification to specific users based on form input 

I would like to ask if someone can help me with this situation?

I've seen an example for checkbox, unfortunately this doesn't apply to my situation.

I have a field that is a group checkbox .

For example:

Field Name: Colours

  • Red
  • Blue 
  • Green

Situation: User ticks all

I've already created a IFFTT rule macro, but I am having problems trying to write a rule that sends emails to the specific teams [ In this case, one email to Red Team & another to Blue team, last to Green Team].

Few questions running through my mind:

1) Do I need three separate IFFTT macros for the three different colours as they are being sent to three different emails?

2) How should my code be for this field "Fire IFTTT action only when this condition/filter is met"? Would the code be [entry.Colours]="Red" ?

Looking forward to hear from the community!

Thanks,

Very Lost Child 

2 answers

1 accepted

3 votes
Answer accepted
Davin Studer Community Leader Jan 11, 2018

Yes, you would need three ifttt macros. And the filter to conditionally fire off the ifttt would look like Colours:Red for the red ifttt, or Colours:Blue for the blue ifttt, etc.

LostChild Jan 12, 2018 • edited

Hi David!

Appreciate your reply.

I gave this a try for many hours and it finally worked.

 

One more tip I've learnt is that, the condition works only if we input the ID.

For example:

ID    Colour

 1     Red

 2     Blue

 3     Green

Condition for IFTTT would be "Colours:1".

 

Thanks for your help!

Davin Studer Community Leader Jan 12, 2018

Yes, that is true. I typically make both the code and name the same so I don't have to worry about that.

LostChild Jan 15, 2018

That makes perfect sense! Thank you!

Alex Medved Jun 28, 2018

Filters in ConfiForms operate on "internal" data, which means it is IDs for dropdowns, not labels, usernames on user fields, not user fullnames, etc

However... :-)

The following filters will match the same

Colours:1

Colours.label:Red

As, we can access field properties, and dropdown field have id and label properties, for example. And you can do it on any "side" of the filtering expression...

See more details on ConfiForms field properties (by type) here

0 votes
Rebecca Bever Apr 02, 2018 • edited

Hi @Davin Studer!

I saw this post and explains almost exactly what I'm doing except my list of recipients is dynamic and changing. I would like a user to have the ability to change the list of recipients at any point.

I can successfully send to one recipient (using a checkbox group or multi-select) but I can't seem to send to more than one even after specifying the Separator as a comma (','). The only way I actually got it to work was using a dropdown but specifically having an option as "email1, email2" which is clearly not what we want.

Is there a specific way of doing this or do I have to manually create a separate IFTTT macro every time a new recipient is added to the list like mentioned above?

Thanks in advance!

Davin Studer Community Leader Apr 02, 2018

So, do you want the user to be able to select the users to send to? If so what about using a multi select user field?

Rebecca Bever Apr 02, 2018

Thanks for the quick reply!

If you're referring to the Users (multiselect) field, unfortunately, they're not users in confluence. They are just different distribution groups that we want to email sometimes and other times not.

I had also tried just the multi-select field and this didn't work like mentioned in my initial post. I've tried using the IFTTT form to specify recipients as [entry.recipients.label], where 'recipients' is the selected field(s). This will work for one recipient selected but not multiple. Like I had mentioned, I've tried adding in a comma as a separator. I've also confirmed by looking at the stored data that multiple emails were selected.

Note sure if I'm missing something. Thanks!

Davin Studer Community Leader Apr 02, 2018

Got it! Try the below example. I think this does what you are trying to do. You'll need the Confluence Source Editor to use the storage format if you don't already have it.

<ac:structured-macro ac:macro-id="c90d7387-ac59-4966-a732-7bba4e64f418" ac:name="confiform" ac:schema-version="1">
<ac:parameter ac:name="formName">test</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="bc284e5c-31d3-4583-a9ee-1e92ae50a9cd" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">recipient</ac:parameter>
<ac:parameter ac:name="fieldLabel">Recipient</ac:parameter>
<ac:parameter ac:name="values">false[foo@stuff.com=Mr. Foo|bar@stuff.com=Ms. Bar|]</ac:parameter>
<ac:parameter ac:name="type">multi</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="61bf3c18-4d81-433e-b972-23e436a76cc9" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">body</ac:parameter>
<ac:parameter ac:name="fieldLabel">Body</ac:parameter>
<ac:parameter ac:name="type">textarea</ac:parameter>
</ac:structured-macro>
</p>
<ac:structured-macro ac:macro-id="3843038e-94af-44cd-9ddf-4762140d685e" ac:name="confiform-entry-register" ac:schema-version="1">
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<ac:structured-macro ac:macro-id="89173857-6203-48cf-bbb7-9634c6b8bdac" ac:name="confiform-ifttt" ac:schema-version="1">
<ac:parameter ac:name="extras3">true</ac:parameter>
<ac:parameter ac:name="action">Send Email</ac:parameter>
<ac:parameter ac:name="event">onCreated</ac:parameter>
<ac:parameter ac:name="title">Test Email from [owner]</ac:parameter>
<ac:parameter ac:name="who">[entry.recipient.transform(id).asList]</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
</ac:rich-text-body>
</ac:structured-macro>
<ac:structured-macro ac:macro-id="67121941-eda8-48c4-9f09-3fd833c9a539" ac:name="confiform-table" ac:schema-version="1">
<ac:parameter ac:name="formName">test</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="bf8b1b88-900e-4f31-9eea-28b1ed5b9b7c" ac:name="confiform-field" ac:schema-version="1">
<ac:parameter ac:name="fieldName">recipient</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="012b88e5-484c-4141-b1c2-7192e71534fe" ac:name="confiform-field" ac:schema-version="1">
<ac:parameter ac:name="fieldName">body</ac:parameter>
</ac:structured-macro>
</p>
<ac:structured-macro ac:macro-id="598e849a-a927-48fa-b80d-8c0eca06e412" ac:name="confiform-entry-edit" ac:schema-version="1">
<ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
</ac:rich-text-body>
</ac:structured-macro>
Rebecca Bever Apr 03, 2018

That did the trick!

Specifically [entry.recipient.transform(id).asList] was the missing piece. Glad to know there is list functionality. Is there any documentation on this? I unfortunately didn't see it in the docs I was looking at.

Thanks again!

Davin Studer Community Leader Apr 03, 2018
Rebecca Bever Apr 03, 2018

Wonderful! Thanks so much for your time!

Davin Studer Community Leader Apr 03, 2018

You're very welcome. If you could click the answered checkbox that would be peachy! Thanks.

Davin Studer Community Leader Apr 03, 2018

Oops! Just realized that this question has already been answered ... this was follow up question. I feel sheepish. :)

Rebecca Bever Apr 03, 2018 • edited

No worries! Thanks so much! I did initially create a ticket here and marked it as answered: https://community.atlassian.com/t5/Marketplace-Apps-questions/Emailing-multiple-recipients-using-Confiform/qaq-p/763575#M42299

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Marketplace Apps & Integrations

Webinar alert! An IT Admin's Guide to Securing Collaboration at Scale

Hello, Atlassian Community! My name is Dave Meyer and I'm a Principal Product Manager at Atlassian. I wanted to give this community a heads up about an upcoming Webinar that might be of interest...

186 views 2 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you