I want emails that are send using adaptavist mail forms to have the "FROM" Field populated by the logged in user. This means that the reciepient who receives the email will see the email as coming from the user who was logged in to Confluence when the form was sent. How do I do this?
Hi @Joe Boothby,
Hope this finds you well. Please let me know the version of Confluence and the version of the plugin you are using.
In order to capture the email id of the user who submits the form without having them input it, you can follow the steps given below.
1. Insert mail-input macro in the form you are creating.
2. Fill the required fields.
3. Give the Velocity value as $!user.email and save the macro.
You can also change the type of the mail-input macro to hidden if you do not wish the user to see this field.
This will automatically fill the email id of the user in the body of the email but not in the "FROM" field of the email
If you wish to have the email address of the sender in the "FROM" field of the email, we have not designed the plugin to have the FROM field filled with the users email address due to security reasons. However, there is one workaround to have the email address populated in the from field but it may not be the same as you expected. You will be able to see the email address of the user as well as the email address configured in the Admin section - Mail Server Configuration. Assuming that you are using Form Mail v4.3.2, I have created an example of the above. Please see below for the Storage format. You can apply the storage format on a test page using Source Editor (free) plugin in order to see the example I created.
Storage Format :
<ac:structured-macro ac:macro-id="4c39d36c-e594-4426-b7de-abec11f6a825" ac:name="mail-form" ac:schema-version="1"><ac:parameter ac:name="subject">subject</ac:parameter><ac:parameter ac:name="generatedUUID">ccc272fc-e607-4f6f-bf0a-1a3d9b7fd025</ac:parameter><ac:parameter ac:name="destination">test@email.com</ac:parameter><ac:rich-text-body> <p><ac:structured-macro ac:macro-id="c3186c30-8d98-43dc-9cbb-ef93a494e892" ac:name="mail-input" ac:schema-version="1"><ac:parameter ac:name="vtlValue">$!user.email</ac:parameter><ac:parameter ac:name="name">fromName</ac:parameter><ac:parameter ac:name="type">hidden</ac:parameter></ac:structured-macro></p> <p><ac:structured-macro ac:macro-id="3edee4ba-f33d-4452-9002-ea4f21152bb4" ac:name="mail-date-picker" ac:schema-version="1"><ac:parameter ac:name="labelText">date</ac:parameter><ac:parameter ac:name="format">dd/mm/yyyy</ac:parameter><ac:parameter ac:name="name">date</ac:parameter></ac:structured-macro></p><ac:structured-macro ac:macro-id="47ab8d03-2dd5-4a93-b0d4-12e932be5d67" ac:name="mail-submit" ac:schema-version="1" /> <p> </p></ac:rich-text-body></ac:structured-macro>
Hope this information was helpful. Should you have any queries please do not hesitate to let us know.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.