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

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

2 votes
Davin Studer Community Champion 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.

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 Champion 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.

That makes perfect sense! Thank you!

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 Champion 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?

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 Champion 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>

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!

Wonderful! Thanks so much for your time!

Davin Studer Community Champion Apr 03, 2018

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

Davin Studer Community Champion Apr 03, 2018

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

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published Apr 19, 2018 in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

366 views 0 6
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you