Confluence automation - Send email with title based on input of page properties macro

Ashok Rao December 12, 2024

Hi,

I have created a page template for my team, and part of that template is a page properties macro with some basic project information (such as name of client, internal project ID number, etc)

Now I would like to create an automation rule to send an email to my team, whereby the title of that email contains some of the information filled into that page properties macro.

Obviously the trigger is 'page published', with a condition added that it can only trigger when using a specific template. However, I am stuck on how to use the information from a page properties macro in the title of an email. 

 

 

 

 

 

2 answers

2 accepted

4 votes
Answer accepted
Manon Soubies-Camy
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 12, 2024

Hi @Ashok Rao and welcome to Community!

As mentioned, you can use Confluence smart values to extract content from your new page. Here's a page example:

page-edit-view.png

And the automation rule that extracts the client name, in this case "ACME":

automation-rule-page.png

Details below:

  • When: Manually trigger
  • Then: Log action
{{page.body.storage}}
  • Then: Log action
{{page.body.storage.substringAfter("Client name</strong></p></th><td><p>")}}
  • Then: Create variable named "varClientName"
{{page.body.storage.substringAfter("Client name</strong></p></th><td><p>")}}
  • Then: Log action
{{varClientName.substringBefore("</p>")}}

This will give you the name of the client, which you can then reuse in emails.

Hope this helps!

- Manon

Manon Soubies-Camy
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 12, 2024

I actually just remembered an even easier text function, you can just use this one to get the client name:

{{page.body.storage.substringBetween("Client name</strong></p></th><td><p>","</p>")}}

 

Like Flavien Gache likes this
Ashok Rao December 12, 2024

Hi Manon, 

Thanks a lot!! Works exactly how I needed.

 

Like Manon Soubies-Camy likes this
Ashok Rao December 12, 2024

One small thing remains though: I guess I will have to trigger that email manually also? I can only trigger your rule after publishing the page, so automatically triggering sending the email as the page is published is not possible?

If that's the case, I will have to pay attention to always first trigger the rule to create the variables, and only after that trigger the rule to create the email.

Manon Soubies-Camy
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 12, 2024

You can change the trigger to the "Page published" one, I just used the manual trigger for debug purposes :)

Ashok Rao December 12, 2024

ah yeah, of course., obiously. Kinda feel stupid there :)

0 votes
Answer accepted
Tomislav Tobijas _Koios_
Solutions Partner
Solution Partners provide consulting, sales, and technical services on Atlassian products.
December 12, 2024

Hi @Ashok Rao ,

You might try using {{page.body}} smart value to get all content from the Confluence page. With that, you probably could parse that data and extract what is needed.

Additionally, you could use automation web requests and Confluence REST API, again to get the page content and potentially parse it within automation.

You could then use this parsed data to send the email notification with the desired content.

Here are some additional references to docs that might help:

Maybe, as a workaround, you would leverage labels and consider adding those to these specific pages as well, and then use smart values for labels to get that additional info you wish to send in the email notification.

Cheers,
Tom

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events