?>

Integrate Mattermost with Amazon SNS

Appy Pie Connect allows you to automate multiple workflows between Mattermost and Amazon SNS

  • No code
  • No Credit Card
  • Lightning Fast Setup
20 Million man hours saved

Award Winning App Integration Platform

About Mattermost

Mattermost is an open source team collaboration platform tht brings all your company's conversations, documents, and applications together in one place, making it easy for your team to collaborate securely on the things that matter most.

About Amazon SNS

The Amazon SNS platform (SNS) is a web service that enables you to send an SMS or a text-enabled mobile push notification to targeted subscribers.

Amazon SNS Integrations

Best ways to Integrate Mattermost + Amazon SNS

  • Mattermost Integration Amazon SNS Integration

    Mattermost + Amazon SNS

    Create Message to Amazon SNS from New Message Posted to Channel in Mattermost Read More...
    Close
    When this happens...
    Mattermost Integration New Message Posted to Channel
     
    Then do this...
    Amazon SNS Integration Create Message
  • Mattermost Integration Amazon SNS Integration

    Mattermost + Amazon SNS

    Create Topic to Amazon SNS from New Message Posted to Channel in Mattermost Read More...
    Close
    When this happens...
    Mattermost Integration New Message Posted to Channel
     
    Then do this...
    Amazon SNS Integration Create Topic
  • Mattermost Integration Mattermost Integration

    Amazon SNS + Mattermost

    Post Message in Mattermost when New Topic is created in Amazon SNS Read More...
    Close
    When this happens...
    Mattermost Integration New Topic
     
    Then do this...
    Mattermost Integration Post Message
  • Mattermost Integration Mattermost Integration

    Amazon SNS + Mattermost

    Post Message in Mattermost when New Subscription is created in Amazon SNS Read More...
    Close
    When this happens...
    Mattermost Integration New Subscription
     
    Then do this...
    Mattermost Integration Post Message
  • Mattermost Integration Gmail Integration

    Mattermost + Gmail

    Create Draft to Gmail from New Message Posted to Channel in Mattermost Read More...
    Close
    When this happens...
    Mattermost Integration New Message Posted to Channel
     
    Then do this...
    Gmail Integration Create Draft
  • Mattermost Integration {{item.actionAppName}} Integration

    Mattermost + {{item.actionAppName}}

    {{item.message}} Read More...
    Close
    When this happens...
    {{item.triggerAppName}} Integration {{item.triggerTitle}}
     
    Then do this...
    {{item.actionAppName}} Integration {{item.actionTitle}}
Connect Mattermost + Amazon SNS in easier way

It's easy to connect Mattermost + Amazon SNS without coding knowledge. Start creating your own business flow.

    Triggers
  • New Message Posted to Channel

    When message post on perticular channel.

  • New Subscription

    Triggers when you add a new subscription.

  • New Topic

    Triggers when you add a new topic.

    Actions
  • Post Message

    Post a new message to a channel.

  • Create Message

    Create a new message.

  • Create Topic

    Create a new topic.

Compliance Certifications and Memberships

Highly rated by thousands of customers all over the world

We’ve been featured on

featuredon
Page reviewed by: Abhinav Girdhar  | Last Updated on July 01, 2022 5:55 am

How Mattermost & Amazon SNS Integrations Work

  1. Step 1: Choose Mattermost as a trigger app and authenticate it on Appy Pie Connect.

    (30 seconds)

  2. Step 2: Select "Trigger" from the Triggers List.

    (10 seconds)

  3. Step 3: Pick Amazon SNS as an action app and authenticate.

    (30 seconds)

  4. Step 4: Select a resulting action from the Action List.

    (10 seconds)

  5. Step 5: Select the data you want to send from Mattermost to Amazon SNS.

    (2 minutes)

  6. Your Connect is ready! It's time to start enjoying the benefits of workflow automation.

Integration of Mattermost and Amazon SNS

Mattermost

Mattermost is an open source, private messaging application for businesses. It’s cross-platform, running on Linux and Mac OSX, top of the line iOS and Android. Mattermost is written in Go. It’s a Slack competitor, but with paid support and a 50% open source business model. There are a bunch of other companies using it, like Atlassian, NCR, Slack, Foursquare, Sony Music Entertainment and more.

Amazon SNS

Amazon SNS stands for Simple Notification Service. It’s a web service that allows you to send notifications to cloud services, mobile apps or end users. The message will be delivered via email, SMS (text messages. or mobile app push notification. You can also use HTTP push for sending messages. This way you can deliver messages via http/s endpoint or command line tops like curl.

Integration of Mattermost and Amazon SNS

Let’s take a look at how we can integrate these two systems together. First off, we’ll need to do some setup on the Amazon SNS side:

Create an Amazon SNS topic Generate an AWS access key Set the permissions for the IAM rpe Create the message that contains the recipient information Create a Lambda function to handle the messages Subscribe to the topic Return the result

The first thing we’re going to do is create a topic on SNS:

Next, in order to send messages through SNS, we’re going to need an AWS access key:

Now that we have an access key, we need to generate an IAM rpe (IAM stands for Identity & Access Management):

Now, let’s set permission so that our IAM rpe can publish to our topic:

This next step will require you to fill out a form. When it comes time to enter the Lambda ARN, enter this in. arn:aws:lambda:us-east-1:[account_id]:function:[function_name] (which will look something like arn:aws:lambda:us-east-1:123456789012:function:myFunction. This will look different than the function name you created when creating your Lambda function. To find out what it is, go back to the AWS Lambda conspe and click on your function. Then click on “Info” in the left hand pane; you should see something like “arn:aws:lambda:us-east-1:[account_id]:[function_name]” which will be used in this step:

Now that we have permission to publish to our topic, let’s create our message. This will look something like this (it will include all of your necessary fields). { "Recipient":{ "Type":"AWS", "Id":"123456789012", "Arn":"arn:aws:sns:[region]:[account_id]:[topic_arn]", "Endpoint":"https://pubsub.us-east-1.amazonaws.com", "Protocp":"email" } } For more information on this structure and all of the fields that are available, visit https://docs.aws.amazon.com/AmazonSNS/latest/DeveloperGuide/sns-topic-content-template.html#sns-topic-content-template-fields Here’s mine for my test account (notice that I replaced my dummy account id [123456789012] with my actual account id [1111111110000]). { "Recipient":{ "Type":"AWS", "Id":"1111111110000", "Arn":"arn:aws:sns:[region]:[account_id]:[topic_arn]" } } Next, we need to create a lambda function so that we can process the messages from our topic and store them in a database like DynamoDB. The code for this is below; it’s pretty straight forward. I used two tables for my purposes; one for the message itself, and one for the sender ID. In my real world example, I would also include a table for the timestamp as well as all of the data needed for sending push notifications (as well as storing it in the message. // s3 bucket must be configured before running this lambda function // See https://matermost.readme.io/docs/instructions-for-using-the-amazon-web-services-conspe#configuring-your-bucket-url import boto3 import json def lambda_handler(event, context). print("Received event". print("data:" + json.dumps(event). response = "success" # Get the message from SNS and unpack it msg = boto3.client('sns'.publish( MessageBody='{"Recipient":{"Type":"AWS","Id":"1111111110000","Arn":"arn:aws:sns:[region]:[account_id]:[topic_arn]"},"Message":{"RecipientType":"AWS","RecipientId":"1111111110000"},"MessageAttributes":{"TopicArn":","Timestamp":"1519187102","MessageId":","LogicalSubscriptionID":"},"MessageData":{"TopicArn":","MessageTimestamp":"1519187102","MessageId":","MessageAttributeUpdate":[],"MessageAttributeDeletion":[],"UserIdentity":{"Arn":"arn:aws:iam::1111111110000:user/jamesbond"},"UserName":"jamesbond"},"MessageSourceIPAddress":["127.0.0.1"]}}' . # Get the message attributes from SNS and unpack them attrs = { 'RecipientType':'AWS', 'Timestamp':time(), 'UserIdentityArn':'arn:aws:iam::1111111110000:user/jamesbond', 'MessageSourceIpAddress':'127.0.0.1' } # Process the unpack data into a dataframe df = pd.DataFrame(attrs. # Now check if there's any data if len(df['MessageData']. > 0 . df = df[df['MessageData']].applymap(json.loads. # If there's data then add it to the database if len(df. > 0 . if 'MessageAttributeUpdate' in df['MessageData']. db_conn = boto3.resource('dynamodb', region_name='us-east-1'. table = db_conn['table'] payload = json.loads(df['MessageAttributeUpdate']['MessageData']. table_item = table_item_dict(table['Key'], table['Value']. # Add the record to table table['AddItem'] = table['Key'] table['AddItem'] += ':' + table['Value'] # Commit the changes table['PutItem'] = table['Key'] db_conn = boto3.resource('dynamodb', region_name='us-east-1'. table = db_conn[table_name] try . table['DeleteItem'] = table['Key'] except KeyError. pass try . table['UpdateItem'] = {"InsertedItem":{"key":","value"}} except KeyError. pass try . table['UpdatedItem'] = {"Item":{"key":","value"}} except KeyError. pass except Exception as e. print("Exception:" + str(e). else . print("No data found". else . print("No data found". else . print("No data found". # Return response return response def table_item_dict(table_name, item). if item is not None and item not in table[table_name]. print("Adding record - "+str(-1. + item + "- to table "+table_name. return {} else . print("Replacing record - "+str(-1. + item + "- with new value". return {'Key'. item} df['MessageAttributes']['UserIdentity'] = user_result(user, 'UserName', 'arn:aws:iam::1111111110000:user/jamesbond'. df['Key'] = df['MessageAttributes']['UserIdentity'] print (" Retrieved message attributes -> key = "+str(df['Key'])+" , value = "+str(df['MessageAttributes']['UserIdentity']). return {'Result':response} def user_result(

The process to integrate Mattermost and Amazon SNS may seem complicated and intimidating. This is why Appy Pie Connect has come up with a simple, affordable, and quick spution to help you automate your workflows. Click on the button below to begin.