Send an Email from Confluence Form
Asked by Samantha Andrade:

Hello,

I have created a form in Confluence for people to submit suggestions. I want the populated information to be sent to my email however, the information does not show up in the email. I only receive an empty email body.

Thank you,

Sam


Answers:
author: Loren
body: <https://community.atlassian.com/t5/Confluence-questions/How-to-receive-email-notification-with-created-ConfiForm/qaq-p/2097714>

I have a question somewhat similar but a little different, if either of you have the answer for this issue.

Thanks

comments: author: Alex Medved _ConfiForms_
body: Take a look at the answer I have provided. More a question for now, to start the investigation. And let's continue there

Alex


author: Loren
body: Thanks again, your tips worked Alex.


author: Alex Medved _ConfiForms_
body: Hi

How have you created your form - are you using some kind of a plugin for that?

Alex

comments: author: Samantha Andrade
body: Hi,

I'm using the ConfiForm macros (ConfiForms Form Definitions). To send the email I have used ConfiForms IFTT Integration Rules

Event: OnCreated

Choose Action to perform: Send Email

No Conditions have been set.

Thanks,

Sam


author: Alex Medved _ConfiForms_
body: Have you put the contents of an email into the macro body?   
Also the ConfiForms Field macros, if you want to send the values from a form's record

Alex


author: Samantha Andrade
body: I think I understand your question.

I've tried adding it two ways:

Pasting the confiform fiele dmacros directly in the IFTT Integration rules body (as seen in the image) vs using notation :ie \[entry.fieldName\]

![ConfiForm Email.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/128125i9C8CB11D66C175F0/image-size/large?v=v2&px=999 "ConfiForm Email.PNG")


author: Alex Medved _ConfiForms_
body: ConfiForms **Field Definition** macros are part of the ConfiForms **Form Definition** - these define and configure the form

I was referring to ConfiForms **Field** macros - these macros you use when you want to get/show the data from the form. So, inside the ConfiForms IFTTT macro body you "get" the values for the fields and need to use ConfiForms **Field** macros

See this tutorial <https://wiki.vertuna.com/display/FORMS/How+to+create+a+form+to+send+emails>

I hope it helps

PS, And yes - the alternative to ConfiForms **Field** macros is to use \[entry.field_name\] notations to extract RAW values for the fields (useful in certain cases like creating mapping for Jira issues and alike, but for emails it is wiser to use ConfiForms **Field** macros)

Alex


author: Samantha Andrade
body: Thanks for this, Alex! It helped


author: Gustavo Ortega Reynoso
body: [@Alex Medved _ConfiForms_](/t5/user/viewprofilepage/user-id/781630)

If I wanted to send an email with fixed data, that is, without the user interacting, I have the idea of setting the value of the fields from the beginning and hiding them, however, how could I do the same with an attachment, note- the attachment will always be the same


author: Alex Medved _ConfiForms_
body: You can use attachment picket field and set it to "attachment id" that you want to include

Each attachment in Confluence has an id, and you can set that to "attachment picker field"

Adding attachment picker field into email (IFTTT macro body) will behave the same way as adding the "file/attachment" field - it will add the file as an attachment to the email

Alex


author: Gustavo Ortega Reynoso
body: Thank you [@Alex Medved _ConfiForms_](/t5/user/viewprofilepage/user-id/781630) for your reply, I have been trying to do this but have not been successful, can you give me a bit more details about this please? I mean how can I get the attachment id?, my attachment is an image and basically I want to send an email to the user after the user logs a Jira issue via commit in Confluence, this email has the information of sla that's why there is no user interaction with this procedure, I already managed to send the mail I just need to attach the image, obviously I have set the fields that I will use to send the email with the corresponding information such as the recipient, the title and the message, additionally I have hidden these fields so that the user does not have interaction with this information

I have this...

![1.png](https://community.atlassian.com/t5/image/serverpage/image-id/195901i46027B0AE335F6B5/image-size/large?v=v2&px=999 "1.png")

Thanks in advance...


author: Alex Medved _ConfiForms_
body: To get an attachment id you can follow the steps below

Open page attachments view

And then click on the attachment element to get the "developer tools"

You will see an id as below

![attachment-id.png](https://community.atlassian.com/t5/image/serverpage/image-id/195938i221CBA0EFC064E33/image-size/large?v=v2&px=999 "attachment-id.png")

We also have a handy user macro that you can use to get the attachment IDs in a more convenient way

<https://wiki.vertuna.com/display/VERTUNA/Attachments+list>

Then it is just a matter of "setting" this id to your picker field

That can be done in the Registrations Control - preset values parameter as fieldname=attachmentId

![preset-values.png](https://community.atlassian.com/t5/image/serverpage/image-id/195939iE9B181C12267CCDA/image-size/large?v=v2&px=999 "preset-values.png")

Alex


author: Gustavo Ortega Reynoso
body: Thanks [@Alex Medved _ConfiForms_](/t5/user/viewprofilepage/user-id/781630) I'm going to work about this, I'll keep u informed...


author: Alex Medved _ConfiForms_
body: Little demo of what's been said

<https://recordit.co/Gbak4EK6Wk>

(of course the field itself (the attachment picker), could be hidden on the form with <https://wiki.vertuna.com/display/CONFIFORMS/ConfiForms+Field+Definition+Rules#ConfiFormsFieldDefinitionRules-Hidefield>)

Hope it helps

Alex


author: Gustavo Ortega Reynoso
body: Dear [@Alex Medved _ConfiForms_](/t5/user/viewprofilepage/user-id/781630) it's working, you are the king!!!

Thanks a lot!!!


author: Gustavo Ortega Reynoso
body: [@Alex Medved _ConfiForms_](/t5/user/viewprofilepage/user-id/781630) the functionality is working, I have a little doubt, in the registration control I set the values for each field that will be sent in the mail, this in the Set values as key=value functionality, for the boddy message field, I need to insert "enter" to line balance, however look in inspect to see how that field goes with "enter" in the xml and indicates \<br\> I already tried it and no, I also put \\n and neither did it, also in the documentation of this property of the registration control neither indicates how to insert an "enter", can you give me a hint?

![3.png](https://community.atlassian.com/t5/image/serverpage/image-id/196306i642DD5F291C50BF1/image-size/large?v=v2&px=999 "3.png")![2.png](https://community.atlassian.com/t5/image/serverpage/image-id/196307iD6DF0108C8CBAE62/image-size/large?v=v2&px=999 "2.png")


author: Alex Medved _ConfiForms_
body: Using \\\\n

![ta-line-break.png](https://community.atlassian.com/t5/image/serverpage/image-id/196308iB3BB040A451B5688/image-size/large?v=v2&px=999 "ta-line-break.png")

And there is no need to put spaces between the = or after the values, unless you want them to appear in the values

Alex


author: Gustavo Ortega Reynoso
body: Thank you very much, my form is working well and the best is becoming more complete

Thanks [@Alex Medved _ConfiForms_](/t5/user/viewprofilepage/user-id/781630)


Tags: atl-orange

confiforms

confluence-server

server