Email API within Forge App

Is there any way to add Email API into Forge Application? I need to be able to send emails to users? If the Atlassian Email API is not supported, is it possible to add another 3rd party solution or will this be blocked by Forge Application?

Hi @Justin_M_John,

I think the Forge Remote is the way you look for. If you need to communicate with various and dynamically specified 3rd-party services (i.e. whose URLs are not known prior to app installation, and therefore cannot be indicated in the app manifest) - such as a mail server - you should set up a (trusted) backend service to do this job for you. All such kind of workloads can be outsourced (in the future) in this “semi-transparent” model.

Best,
Márton

2 Likes

If you are writing a JIRA app, have you considered: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-notify-post ?

4 Likes

I ended up using the Jira issue types to send emails to user. Thank you everyone

@Justin_M_John can you elaborate on what you did to send emails? Did you use the issue notification mechanism @rmassaioli outlined or something else? We’d really like to use the notification mechanism to send a message to an atlassian id but we don’t want to stuff the message content in an issue where anyone can see it.

Hello @jeffryan

You don’t need to put any message content into an issue, put it all into the body of the message via the htmlBody and / or textBody parameters of the REST API endpoint.

Find a random issue where the intended message recipient is the Reporter, then send a message to only the Reporter for that Issue:

POST /rest/api/3/issue/{issueIdOrKey}/notify
BODY:

{
    "subject": "This is the message subject",
    "htmlBody": "This is the HTML version of the message body.",
    "textBody": "This is the text version of the message body.",
    "to": {
        "reporter": true,
        "assignee": false,
        "voters": false,
        "watchers": false,
        "groupIds": []
    }
}

There’s no record in the issue of the message sent to the Reporter.

2 Likes

Oh thats interesting. Thanks @sunnyape! I guess the only downside is I need to first find an issue where that user is the reporter (or one of those other roles) in order to notify them.

1 Like