How to send custom email notification to matched username
Asked by Kevin Shiflet:

I would like to create custom email notifications for certain activities my users could take in Trello, including assigning a card, changing a label or custom field, or commenting and tagging someone.

Butler appears to limit the recipients of custom email notifications to 1) specific email address, 2) All members of a card, 3 All members of a board.

Is there any way to instead dynamically insert the email address dynamically according to the matched user name or triggering user name?

[Butler variables - Trello Help](https://help.trello.com/article/1157-variables#member-variables)


Answers:
author: Hannah Humbert - Simpla Workflows
body: Hi [@Kevin Shiflet](/t5/user/viewprofilepage/user-id/4860807) ! Welcome to the community :) I guess Trello would need some way of understanding what username corresponds to what email address. An idea could be to create a list and then add a card for each user. The title of the card would be the user's Trello username. This list could exist on the board where the activity is happening, or you might want to store it on a separate board. From there, you can create a custom field called "Email". In each "user card", input their email address. Then, your rule could look like this:  

when X happens, find a card titled "{username}" on board "Directory", and send an email notification to "{{%Email}}"  

If you don't have custom fields due to being on the free plan, you could just add the email address to the description and just use the {carddescription} variable.

comments: author: Kevin Shiflet
body: [@Hannah Humbert - Simpla Workflows](/t5/user/viewprofilepage/user-id/2109993) thanks so much for getting back to me so quickly. I did try the solution you suggested and I'm still having trouble. I put together a new board called Directory, and named a card my username, as you said. The activity I'm looking for to trigger is a tagged comment on a card on a different board.

Then I added a custom field called 'EmailAddress' to that Directory board with my email address and attempted to run the rule like you mentioned.

The rule goes as:

'find a card titled {username} on board 'Directory'

then

'send an email notification to 'EmailAddressvalue' with subject blahblahblah...

I'm not receiving a notification though. Can you see any obvious error I'm missing?

Thanks for all your help on this.


author: Hannah Humbert - Simpla Workflows
body: [@Kevin Shiflet](/t5/user/viewprofilepage/user-id/4860807) try instead: "send an email notification to "*{{%Emailaddress}}*""


author: Kevin Shiflet
body: [@Hannah Humbert - Simpla Workflows](/t5/user/viewprofilepage/user-id/2109993) I tried that and a few variants of that and haven't had success yet. :(

Attaching some screenshots. Let me know if you think I'm missing anything obvious.

![20220406-153922_PickPick Image_001.png](https://community.atlassian.com/t5/image/serverpage/image-id/191856i942302C9DAEED008/image-size/large?v=v2&px=999 "20220406-153922_PickPick Image_001.png")![20220406-153904_PickPick Image_001.png](https://community.atlassian.com/t5/image/serverpage/image-id/191858i117C4B7FF6CEB9E9/image-size/large?v=v2&px=999 "20220406-153904_PickPick Image_001.png")![20220406-153851_PickPick Image_001.png](https://community.atlassian.com/t5/image/serverpage/image-id/191861i4F5E87E212CAA93B/image-size/large?v=v2&px=999 "20220406-153851_PickPick Image_001.png")


author: Hannah Humbert - Simpla Workflows
body: Try {{%Emailaddress}} - you don't need to add "value" into it.


author: Hannah Humbert - Simpla Workflows
body: ![rule action.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/191872i976033DDE48D6F20/image-dimensions/262x363?v=v2 "rule action.PNG")


author: Kevin Shiflet
body: [@Hannah Humbert - Simpla Workflows](/t5/user/viewprofilepage/user-id/2109993) thanks for your continued assistance on this. I tried this formatting and got an error:

The email address {{%emailaddress} is invalid.

I tried a few different permutations and either got the above error or 'No email address to send to'.

Any thoughts? I don't want to, but I could try moving the directory bit to the same board and just squirrel away the list far to the right.


author: Hannah Humbert - Simpla Workflows
body: Oops, looks like my screenshot had a typo. The variable should be {{%Emailaddress}} as mentioned above. Just make sure the field name is spelled the same as your custom field (including any spaces). There's more info on custom field variables here: <https://help.trello.com/article/1160-custom-field-variables#custom-field-variables>


author: Kevin Shiflet
body: [@Hannah Humbert - Simpla Workflows](/t5/user/viewprofilepage/user-id/2109993) thanks for sharing this! It finally worked! I switched it to {matchedusername} and it still worked so I think this should be good.

Thanks for all your help on this.


author: Kevin Shiflet
body: [@Hannah Humbert - Simpla Workflows](/t5/user/viewprofilepage/user-id/2109993) One caveat on this, the email body references the card link, which should go back to the commented card, but instead it's going back to the directory card with the email address on it.

Do you know what's best to get the commented card instead?


author: Hannah Humbert - Simpla Workflows
body: For your particular trigger, {matchedusername} would find the user that has been @mentioned. {username} will be the user who was associated with the action.   

If you're wanting to pull details from the trigger card into your email message, prefix everything with "trigger". So, {triggercardname}, {triggercardlink}, etc.


author: Kevin Shiflet
body: [@Hannah Humbert - Simpla Workflows](/t5/user/viewprofilepage/user-id/2109993) that did the trick!


author: Hannah Humbert - Simpla Workflows
body: Awesome! Glad that's all working now :)