Dev repo for Amazon Lambda implementation for Fluent Support WordPress Plugin's Email Piping
- You must have to use a domain (can be a secondary domain) for email receiving in amazon SES.
- You may need a bit of development/coding experience to deploy the script.
- This script used serverless framework, Please check the serverless documentation first.
- It's written in nodejs, so you need nodejs installed on your computer.
- Install serverless.js on your computer to deploy this.
- Clone this repository
- run
npm install
- run
- Create a SES verified Domain but do not setup the "Rule Set"
- Edit
serverless.yml
Line Number:7 & 8
and choose a unique S3 bucket name but follow the normalizing Rules to allow to use the name for thebucketRef
. To keep it working use a name which contains only the characters a-z. ThebucketRef
is the constant stringS3Bucket
plus thebucket
name with the first letter uppercase. - if you change the region check if SES receiving exists in your region
- Edit the handler.js file and replace
your_unique_s3_file_bucket
with your own s3 bucket name. You have to create this bucket. Will be used to store the attachments and you set the policy to delete objects automatically older than 1-2 days
Setup in WordPress
- add
define('FLUENTSUPPORT_ENABLE_CUSTOM_PIPE', true);
on your WordPress site's wp-config.php file to enable custom email piping for Fluent Support. - Next create an email inbox in Fluent Support as email type and you should get a webhook url for email piping.
- edit
mappers.js
file in this repo and map your forwarding email (your own email and your custom masked email) with the webhook URL. Provide both your own masked email and origin email for the same webhook url
In order to deploy the example, simply run:
serverless deploy
Setup SNS Email Receiving Rule
- Open the Amazon SES console at https://console.aws.amazon.com/ses/
- In the navigation pane, under Email Receiving, choose Rule Sets.
- Choose Create a Receipt Rule.
- On the Recipients page, choose Next Step. (Without a adding any recipients, Amazon SES applies this rule to all recipients)
- For Add action, choose S3.
- For S3 bucket,choose Enter a bucket name and select the bucket with the name you defined in
serverless.yml
- Choose Next Step
- On the Rule Details page, for Rule name, type my-rule. Select the check box next to Enabled, and then choose Next Step.
- On the Review page, choose Create Rule.