Giter Site home page Giter Site logo

moonmail / moonmail Goto Github PK

View Code? Open in Web Editor NEW
2.0K 55.0 306.0 29.44 MB

Email marketing platform for bulk emailing via Amazon SES (Google Cloud Platform and Azure coming soon)

Home Page: https://moonmail.io/

License: Other

JavaScript 97.47% HTML 2.28% Shell 0.25%
serverless moonmail email-marketing lambda aws marketing-automation email-campaigns liquid email-validation email-verification

moonmail's Introduction

MoonMail

Build Status Coverage Status Twitter GitHub license Gitter

Send email marketing campaigns with Amazon SES. Let Amazon Lambda compose email by email and literaly scale it to infinite.

With MoonMail you can: create & edit lists of recipients (email addresses) and store them within a DynamoDB. Create & edit html email marketing campaigns, send them and track their opens and clicks.

The biggest magic of MoonMail: SEND BILLIONS OF EMAILS WITH NO SERVERS!

See the wiki for detailed specs and infrastructure graphs.

Live Features

Free Perks

Getting Started

Requirements

Notes about the serverless version

Version 0.5.x is required to run several parts of the MoonMail API such as the api and events sub-packages, for these, the root of the repository provides the required s-project.json, s-resources-cf.json and s-templates.json. Find more information about how to handle functions with serverless 0.5 here.

The rest of the services require serverless 1.x and are self-contained. For details on how to manage them, you should follow the instructions provided in their respective README.md

Dependencies

Install serverless 0.5 globally:

yarn global add [email protected]

Install the root project dependencies:

yarn install

Install the API dependencies:

cd api && yarn install

Install the event processors' dependencies:

cd events && yarn install

Installing the dependencies for the rest of the services follow the same convention. You just need to cd into it and install its dependencies.

Initialize and configure the Serverless 0.5 project

sls project init -c -n your-lower-case-project-name

Configure the s-variables-<stage>-<region>.json files inside the _meta directory by providing the required variables.

Deployment

Servereless 0.5 resources

Create all the needed resources in your AWS account:

sls resources deploy

Deploy all the Lambda functions:

sls function deploy

Deploy MoonMail events:

sls event deploy

Create the API Gateway endpoints:

sls endpoint deploy

Troubleshooting:

Due to the amount of resources it might be difficult to deploy everything at once. It's totally fine to cd into sub-directories of api or events and perform the above mentioned actions in order to reduce the scope of deployments. Also, using the dash deploy subcommand might be useful when deploying independent functions. Aside from that, there are some functions depending on serverless 0.5 which require NodeJS > 4.3. For those, you will have to change the runtime version through the AWS Lambda Console because it's not supported to do so through Serverless on this version.

If the above doesn't solve your issues, there are a couple of things you should double check:

1.- Your current Serverless version (different parts of the project require different versions), this is how you can do it:

sls --version

2.- You have provided all the required variables in the _meta directory.

3.- An admin.env file should exist in the root of the project containing the AWS profile to be used by the deployments (this only applies for the function and resources depending on [email protected]). Here is an example of what it should look like:

AWS_DEV_PROFILE=moonmail-dev
AWS_PROD_PROFILE=moonmail-prod  

4.- The provided profile in admin.env should exist in your ~/.aws/credentials

Serverless 1.x resources

To configure and deploy these, you will have to follow the instructions provided in their respective README.md

Live demo

If you have set up everything correctly you'll be able to send an email campaign using our demo ui

Questions?

Please post your questions on StackOverflow and tag them with: moonmail.

Contributing Guidelines

Contributions are always welcome! If you'd like to collaborate with us, take into account that:

Feel free to contact us if you have any question

License

MoonMail is available under the MIT license. See the LICENSE file for more info.

Professional Help

If you need support getting MoonMail into production in your AWS account, contact the Email Marketing and Serverless Experts:

Promote your Serverless services by creating a MoonMail account

MoonMail Email Marketing Software done the right way

moonmail's People

Contributors

alexandresaiz avatar alua-kinzhebayeva avatar amazonkaiv avatar andylibrian avatar apaatsio avatar aspiers avatar bcruddy avatar danielgallardo avatar davidgf avatar espen avatar jefersons avatar jimmyn avatar joostfarla avatar karloscodes avatar rhinoandre avatar ryansb avatar xndrdev avatar yasoob avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

moonmail's Issues

Serverless V1.0

Is it part of your roadmap to switch from serverless v0.5 to v1.0?

ServerlessError: Function Deployment Failed

I am seeing the below error when I try to deploy functions.

Commands run until now

yarn global add [email protected]
yarn install
cd api && yarn install
cd events && yarn install
sls project init -c -n your-lower-case-project-name

<Updated required variables>

sls resources deploy
sls function deploy

Others Commands to address some Issues

npm i babel-plugin-transform-builtin-extend
npm install serverless-runtime-babel --save
npm install --save-dev babel-plugin-transform-async-to-module-method
npm i emitter

Error

Serverless: Deploying the specified functions in "dev" to the following regions: us-west-2
Serverless: ------------------------
Serverless: Failed to deploy the following functions in "dev" to the following regions:
Serverless: us-west-2 ------------------------
Serverless:   createAutomationAction: undefined
Serverless:   updateAutomationAction: undefined
Serverless:   listAutomationActions: undefined
Serverless:   getAutomationAction: undefined
Serverless:   deleteAutomationAction: undefined
Serverless:   listSegmentsHttp: undefined
Serverless:   updateSegmentHttp: undefined
Serverless:   listSegmentMembersHttp: undefined
Serverless:   getSegmentHttp: undefined
Serverless:   createSegmentHttp: undefined
Serverless:   getCampaignReport: undefined
Serverless:   getAggregatedClicks: undefined
Serverless:   updateRecipient: undefined
Serverless:   getAggregatedOpens: undefined
Serverless:   unsubscribeRecipient: undefined
Serverless:   setUnsubscribeReason: undefined
Serverless:   searchRecipientsHttp: undefined
Serverless:   subscribeRecipient: undefined
Serverless:   listRecipientsHttp: undefined
Serverless:   getTotalRecipientsHttp: undefined
Serverless:   getRecipient: undefined
Serverless:   deleteRecipient: undefined
Serverless:   createRecipient: undefined
Serverless:   updateEmailList: undefined
Serverless:   bulkDeleteRecipients: undefined
Serverless:   sendTestConfirmationEmail: undefined
Serverless:   resetConfirmationEmailBody: undefined
Serverless:   listEmailLists: undefined
Serverless:   getEmailList: undefined
Serverless:   exportEmailList: undefined
Serverless:   createEmailList: undefined
Serverless:   deleteEmailList: undefined
Serverless:   linkClick: undefined
Serverless:   getLinks: undefined
Serverless:   emailOpen: undefined
Serverless:   updateTemplate: undefined
Serverless:   listTemplates: undefined
Serverless:   getTemplate: undefined
Serverless:   getBeeTokenProxy: undefined
Serverless:   duplicateTemplate: undefined
Serverless:   deleteTemplate: undefined
Serverless:   createTemplate: undefined
Serverless:   updateCampaign: undefined
Serverless:   unscheduleCampaign: undefined
Serverless:   sendTestEmail: undefined
Serverless:   sendTestCampaign: undefined
Serverless:   scheduleCampaign: undefined
Serverless:   listCampaigns: undefined
Serverless:   getCampaign: undefined
Serverless:   duplicateCampaign: undefined
Serverless:   deleteCampaign: undefined
Serverless:   updateAutomation: undefined
Serverless:   createCampaign: undefined
Serverless:   deliverCampaign: undefined
Serverless:   pauseAutomation: undefined
Serverless:   createAutomation: undefined
Serverless:   getAutomation: undefined
Serverless:   listAutomations: undefined
Serverless:   activateAutomation: undefined
/Users/amemon1/.config/yarn/global/node_modules/bluebird/js/release/async.js:49
        fn = function () { throw arg; };
                           ^

ServerlessError: Function Deployment Failed
    at new ServerlessError (/Users/amemon1/.config/yarn/global/node_modules/serverless/lib/Error.js:17:11)
    at FunctionDeploy.<anonymous> (/Users/amemon1/.config/yarn/global/node_modules/serverless/lib/actions/FunctionDeploy.js:126:19)
    at next (/Users/amemon1/.config/yarn/global/node_modules/rimraf/rimraf.js:83:7)
    at CB (/Users/amemon1/.config/yarn/global/node_modules/rimraf/rimraf.js:119:9)
    at FSReqWrap.args [as oncomplete] (fs.js:140:20)
From previous event:
    at FunctionDeploy.functionDeploy (/Users/amemon1/.config/yarn/global/node_modules/serverless/lib/actions/FunctionDeploy.js:105:10)
From previous event:
    at /Users/amemon1/.config/yarn/global/node_modules/serverless/lib/Serverless.js:186:31
    at Array.reduce (<anonymous>)
    at /Users/amemon1/.config/yarn/global/node_modules/serverless/lib/Serverless.js:185:32
From previous event:
    at Serverless._execute (/Users/amemon1/.config/yarn/global/node_modules/serverless/lib/Serverless.js:183:12)
    at Serverless.actions.(anonymous function) (/Users/amemon1/.config/yarn/global/node_modules/serverless/lib/Serverless.js:429:20)
    at Serverless.command (/Users/amemon1/.config/yarn/global/node_modules/serverless/lib/Serverless.js:398:38)
    at /Users/amemon1/.config/yarn/global/node_modules/serverless/bin/serverless:19:16
    at runCallback (timers.js:705:18)
    at tryOnImmediate (timers.js:676:5)
    at processImmediate (timers.js:658:5)
    at process.topLevelDomainCallback (domain.js:120:23)
From previous event:
    at Object.<anonymous> (/Users/amemon1/.config/yarn/global/node_modules/serverless/bin/serverless:18:4)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)

Lists API refactor

Modify table structure: userId as Hash Key and id as Range Key. Use moonmail-models

not clear what to set publicApiARN to

s-templates.json contains this fragment which relies on the publicApiARN variable being set:

  "apiGatewayStatementTemplate": {
    "Effect": "Allow",
    "Action": [
      "apigateway:POST",
      "apigateway:DELETE"
    ],
    "Resource": [
      "${publicApiARN}"
    ]
  },

If you don't set it, deploying the CF stack via sls resources deploy fails with:

19:49:11 UTC+0100 | CREATE_FAILED | AWS::IAM::Policy | IamPolicyLambda | Resource ${publicApiARN} must be in ARN format or "*".
-- | -- | -- | -- | --

and a near useless stack-trace:

Serverless: |   serverless:lib.actions.ResourcesDeploy CF stack status:  CREATE_IN_PROGRESS +6s                                      
Serverless: -   serverless:lib.actions.ResourcesDeploy CF stack status:  CREATE_IN_PROGRESS +5s                                      
Serverless: \   serverless:lib.actions.ResourcesDeploy CF stack status:  CREATE_IN_PROGRESS +5s                                      
Serverless: /   serverless:lib.actions.ResourcesDeploy CF stack status:  CREATE_IN_PROGRESS +5s                                      
Serverless: -   serverless:lib.actions.ResourcesDeploy CF stack status:  CREATE_IN_PROGRESS +5s                                      
Serverless: |   serverless:lib.actions.ResourcesDeploy CF stack status:  CREATE_IN_PROGRESS +5s                                      
Serverless: /   serverless:lib.actions.ResourcesDeploy CF stack status:  CREATE_IN_PROGRESS +5s                                      
Serverless: \   serverless:lib.actions.ResourcesDeploy CF stack status:  DELETE_IN_PROGRESS +5s                                      
/home/adam/.config/yarn/global/node_modules/bluebird/js/release/async.js:61                                                          
        fn = function () { throw arg; };
                           ^

ServerlessError: ServerlessError: An error occurred while provisioning your cloudformation: undefined
    at new ServerlessError (/home/adam/.config/yarn/global/node_modules/serverless/lib/Error.js:17:11)
    at ResourcesDeploy.<anonymous> (/home/adam/.config/yarn/global/node_modules/serverless/lib/actions/ResourcesDeploy.js:241:25)
From previous event:
    at /home/adam/.config/yarn/global/node_modules/serverless/lib/actions/ResourcesDeploy.js:236:23
From previous event:
    at ResourcesDeploy._deployResources (/home/adam/.config/yarn/global/node_modules/serverless/lib/actions/ResourcesDeploy.js:158:12)
From previous event:
    at ResourcesDeploy.resourcesDeploy (/home/adam/.config/yarn/global/node_modules/serverless/lib/actions/ResourcesDeploy.js:72:12)
From previous event:
    at /home/adam/.config/yarn/global/node_modules/serverless/lib/Serverless.js:186:31
    at Array.reduce (native)
    at /home/adam/.config/yarn/global/node_modules/serverless/lib/Serverless.js:185:32
From previous event:
    at Serverless._execute (/home/adam/.config/yarn/global/node_modules/serverless/lib/Serverless.js:183:12)
    at Serverless.actions.(anonymous function) (/home/adam/.config/yarn/global/node_modules/serverless/lib/Serverless.js:429:20)
    at Serverless.command (/home/adam/.config/yarn/global/node_modules/serverless/lib/Serverless.js:398:38)
    at /home/adam/.config/yarn/global/node_modules/serverless/bin/serverless:19:16
    at runCallback (timers.js:672:20)
    at tryOnImmediate (timers.js:645:5)
    at processImmediate [as _immediateCallback] (timers.js:617:5)
From previous event:
    at Object.<anonymous> (/home/adam/.config/yarn/global/node_modules/serverless/bin/serverless:18:4)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:427:7)
    at startup (bootstrap_node.js:151:9)
    at bootstrap_node.js:542:3

Admittedly, serverless does give a warning about it just before that:

Serverless: WARNING: This variable is not defined: publicApiARN                                                                      

but this is drowned out by about 30 other near identical warnings.

Unfortunately it is not documented anywhere what to set this to, therefore I can't imagine how anyone other than an AWS / CloudFormation / MoonMail expert could ever successfully figure out how to deploy MoonMail themselves.

So what should it be set to?

This same question was asked on StackOverflow a few months ago but (rather unfairly IMHO) got 2 downvotes and was deleted:

N.B. IIUC you need >10k reputation on StackOverflow to view this since it was deleted, so here's a screenshot:

publicapiarn

No API or Events directories

First, I'll admit I'm outside of my element regarding Serverless setups. That said, the instructions seem simple enough but I keep hitting a snag.

cd: api: No such file or directory

Any idea what's up?

API cannot be deployed

All services that use Serverless 0.5.4, require the nodejs4.3 runtime. AWS stopped supporting nodejs4.3, and I haven't found any way to change the runtime of the functions.

There was another ticket about this, but it has been closed without a response, so I thought I would submit a new one.

Thanks!

need some clarification?

could you pls tell me , is that possible to integrate it with MEAN stack app.?

if possible means kindly guide me ?

thank you

Received error: This plugin could not be found: serverless-runtime-babel

root@moonmail:~/MoonMail/events# sls project init -c -n samplemoonmail
/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/async.js:61
        fn = function () { throw arg; };
                           ^

ServerlessError: This plugin could not be found: serverless-runtime-babel
    at new ServerlessError (/usr/local/lib/node_modules/serverless/lib/Error.js:17:11)
    at Serverless._loadPlugins (/usr/local/lib/node_modules/serverless/lib/Serverless.js:298:17)
    at Serverless.loadProjectPlugins (/usr/local/lib/node_modules/serverless/lib/Serverless.js:245:10)
    at /usr/local/lib/node_modules/serverless/lib/Serverless.js:76:41
From previous event:
    at Serverless.init (/usr/local/lib/node_modules/serverless/lib/Serverless.js:72:25)
    at Object.<anonymous> (/usr/local/lib/node_modules/serverless/bin/serverless:17:12)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
    at startup (internal/bootstrap/node.js:266:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:596:3)

sls funcation deploy give me error

Dears

I have an issue when run command #sls funcation deply with the following error

[root@moonmail2 marketingmail]# sls resources deploy
Serverless: Deploying resources to stage "dev" in region "us-east-1" via Cloudformation (~3 minutes)...
Serverless: No resource updates are to be performed.
[root@moonmail2 marketingmail]# sls funcation deploy
/usr/local/share/.config/yarn/global/node_modules/bluebird/js/release/async.js:61
fn = function () { throw arg; };
^

ServerlessError: Command not found. Enter "serverless help" to see all available commands.
at new ServerlessError (/usr/local/share/.config/yarn/global/node_modules/serverless/lib/Error.js:17:11)

Nodejs Version 8
[email protected]

segments based on click-through of specific campaigns or even links

Currently segments can be created based on actions relating to a certain number of campaigns, or campaigns within a particular time window:

a__cetza

-a3mfyk9

However it would be very useful to be able to create segments based on more fine-grained actions, e.g.

  • A user registers interest on a particular topic by clicking any link within a specific campaign
  • A user registers interest on a particular topic by clicking a specific link within a specific campaign
  • A user registers interest on a particular topic through some external action (e.g. a comment on a facebook page), and I want to track that interest by manually adding them to the segment.

Currently if I have an overall product or topic area but also need to track interest in specific sub-topics (e.g. different features or aspects of the product), it seems I would need to create a list for each sub-topic, and then have people's subscriptions duplicated across multiple lists if they have multiple interests. And this doesn't seem like a good solution, hence my request for more fine-grained segmentation control above. Or am I missing something?

I would be more than happy to help test the development of this feature! In an ideal world I could even help with the coding, although I fear I'm very unlikely to have enough free time for that (unless it's really easy and I got some pointers from people who know the code well).

sls function deploy failed, can't find module handler

Hello,
Thank you first for the great project.
I am having trouble with sls function deploy command. I got the following error:

Serverless: | events.js:183
throw er; // Unhandled 'error' event
^

Error: Cannot find module './handler' from '/home/jackie/Desktop/MoonMail/_meta/_tmp/updateUserReputation@1557570598954/events/users/updateUserReputation'
at /home/jackie/Desktop/MoonMail/node_modules/resolve/lib/async.js:61:35
at load (/home/jackie/Desktop/MoonMail/node_modules/resolve/lib/async.js:80:43)
at onex (/home/jackie/Desktop/MoonMail/node_modules/resolve/lib/async.js:105:17)
at /home/jackie/Desktop/MoonMail/node_modules/resolve/lib/async.js:26:73
at FSReqWrap.oncomplete (fs.js:152:21)

I have tried `yarn add global handler but it doesn't work.

nodejs v8.16.0
yarn 1.15.2

And it keeps saying that uglify-js failed and SyntaxError? Is that a problem?

Thank you!

README syntax invalid

For Serverless 1.25.0

The command

sls project init -c -n your-lower-case-project-name

is invalid

Yielding the response "Serverless command "project" not found"

Remove automations

The whole automations service has been deprecated and it is to be fully removed along with all dependencies. MoonMail stays as an only mass marketing email service.

Default install instructions are out of date

AFAICT the API to sever less has changed, so the default instructions to MoonMail are out of date.

I've then installed an older version of Serverless, [email protected]

sls resources deploy displays a lot of warnings, then fails (due to the warnings).

MoonMail$ sls resources deploy
Serverless: WARNING: This variable is not defined: defaultRCU
Serverless: WARNING: This variable is not defined: defaultWCU
Serverless: WARNING: This variable is not defined: sentEmailsRCU
Serverless: WARNING: This variable is not defined: sentEmailsWCU
Serverless: WARNING: This variable is not defined: defaultRCU
Serverless: WARNING: This variable is not defined: defaultWCU
Serverless: WARNING: This variable is not defined: scheduledAtIndexRCU
Serverless: WARNING: This variable is not defined: scheduledAtIndexWCU
Serverless: WARNING: This variable is not defined: defaultRCU
Serverless: WARNING: This variable is not defined: defaultWCU
Serverless: WARNING: This variable is not defined: defaultRCU
Serverless: WARNING: This variable is not defined: defaultWCU
Serverless: WARNING: This variable is not defined: defaultRCU
Serverless: WARNING: This variable is not defined: defaultWCU
Serverless: WARNING: This variable is not defined: recipientsRCU
Serverless: WARNING: This variable is not defined: recipientsWCU
Serverless: WARNING: This variable is not defined: defaultRCU
Serverless: WARNING: This variable is not defined: defaultWCU
Serverless: Deploying resources to stage "dev" in region "us-east-1" via Cloudformation (~3 minutes)...
/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/async.js:61
fn = function () { throw arg; };
^

ServerlessError: ServerlessError: An error occurred while provisioning your cloudformation: undefined
at new ServerlessError (/usr/local/lib/node_modules/serverless/lib/Error.js:17:11)
at ResourcesDeploy. (/usr/local/lib/node_modules/serverless/lib/actions/ResourcesDeploy.js:244:25)
at ResourcesDeploy.tryCatcher (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:510:31)
at Promise._settlePromise (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:567:18)
at Promise._settlePromise0 (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:612:10)
at Promise._settlePromises (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:687:18)
at Async._drainQueue (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/async.js:138:16)
at Async._drainQueues (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/async.js:148:10)
at Immediate.Async.drainQueues as _onImmediate
at tryOnImmediate (timers.js:534:15)
at processImmediate as _immediateCallback

If I hard code the above named variables in s-resources-cf.json then deploy gets further, but then gets what looks like other AWS permission errors.

My IAM user is an Admin.

$ more s-variables-dev-us-east-1.json
{
defaultRCU: 2, // just in case thus made it through to s-resources-cf.json
defaultWCU: 2, // but they didn't
sentEmailsRCU: 2,
sentEmailsWCU: 2,
scheduledAtIndexRCU: 2,
scheduledAtIndexWCU: 2,
recipientsRCU: 2,
recipientsWCU: 2,
apiHost: "txm.net"
}

Not really sure what else I can try :/

sls command no longer relevant

Hi, According to the instructions: running the following command should build your service:

sls project init -c -n your-lower-case-project-name

However, after installing serverless it can not find the command project let alone init. Is there any serverless command that can be used with a newer version of serverless as "project" is deprecated.

Unsubscribe link not working

The unsubscribe link it's not working, I realized it required the variable "unsubscribedCallbackUrl" to be set to something, but don't know what is it and there's nowhere in the docs talking about it

Can moonmail run completely self hosted with our own SMTP servers?

Hi there,

We were exploring options to move out of our current email marketing platform (good old phplist). We send out few million emails to our clients regarding various products and features. We have a very good self hosted smtp server which can send over 1.5k emails a minute. We recently stumbled upon moonmail and was wondering if its possible to host it and run using a custom smtp server?

Thanks

How to set config / env vars?

First, this project is fantastic. Thank you @davidgf and @alexandresaiz for the great work, and to the Microapps team for open sourcing it!

I'm a bit new to the Serverless world and I'm not sure how magical the install process should be. Are the env / config variables supposed to be auto-set based on the newly created resources?

I'm using Serverless 0.5.5

My serverless init indicates I have several undefined variables (See below).

sls project init
 _______                             __
|   _   .-----.----.--.--.-----.----|  .-----.-----.-----.
|   |___|  -__|   _|  |  |  -__|   _|  |  -__|__ --|__ --|
|____   |_____|__|  \___/|_____|__| |__|_____|_____|_____|
|   |   |             The Serverless Application Framework
|       |                           serverless.com, v0.5.5
`-------'


Serverless: Initializing Serverless Project...  
Serverless: Enter a new stage name for this project:  (dev) prod
Serverless: For the "prod" stage, do you want to use an existing Amazon Web Services profile or create a new one?
  > Existing Profile
    Create A New Profile
Serverless: Select a profile for your project: 
  > serverless-dev-profile
Serverless: Creating stage "prod"...  
Serverless: Select a new region for your stage: 
  > us-east-1
    us-west-2
    eu-west-1
    eu-central-1
    ap-northeast-1
Serverless: Creating region "us-east-1" in stage "prod"...  
Serverless: WARNING: This variable is not defined: recipientsImportBucket  
Serverless: WARNING: This variable is not defined: account-id  
Serverless: WARNING: This variable is not defined: account-id  
Serverless: Deploying resources to stage "prod" in region "us-east-1" via Cloudformation (~3 minutes)...  
Serverless: \ Serverless: WARNING: This variable is not defined: opensStreamName  
Serverless: WARNING: This variable is not defined: clicksStreamName  
Serverless: WARNING: This variable is not defined: recipientsImportBucket  
Serverless: WARNING: This variable is not defined: clicksStreamName  
Serverless: WARNING: This variable is not defined: clicksStreamARN  
Serverless: WARNING: This variable is not defined: opensStreamName  
Serverless: WARNING: This variable is not defined: opensStreamARN  
Serverless: WARNING: This variable is not defined: attachRecipientsTopicARN  
Serverless: WARNING: This variable is not defined: apiHost  
Serverless: WARNING: This variable is not defined: sendCampaignTopicARN  
Serverless: WARNING: This variable is not defined: sendEmailsTopicARN  
Serverless: WARNING: This variable is not defined: recipientsImportBucket  
Serverless: WARNING: This variable is not defined: account-id  
Serverless: WARNING: This variable is not defined: account-id  
/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/async.js:61
        fn = function () { throw arg; };
                           ^

ServerlessError: ServerlessError: An error occurred while provisioning your cloudformation: The following resource(s) failed to create: [ClicksStream, ListsTable, RecipientsTable, SendEmailsTopic, PrecompileCampaignTopic, PrecompileEmailTopic, AttachRecipientsTopic, LinksTable, OpensStream, IamRoleLambda]. . Delete requested by user.
    at new ServerlessError (/usr/local/lib/node_modules/serverless/lib/Error.js:17:11)
    at ResourcesDeploy.<anonymous> (/usr/local/lib/node_modules/serverless/lib/actions/ResourcesDeploy.js:242:25)
    at ResourcesDeploy.tryCatcher (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:502:31)
    at Promise._settlePromise (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:559:18)
    at Promise._settlePromise0 (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:604:10)
    at Promise._settlePromises (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:679:18)
    at Async._drainQueue (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/async.js:138:16)
    at Async._drainQueues (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/async.js:148:10)
    at Immediate.Async.drainQueues [as _onImmediate] (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/async.js:17:14)
    at processImmediate [as _immediateCallback] (timers.js:383:17)

i have discovered stored xss on your websites

i have mentionned a many white hat program
many website bug bounty mentionned moonmail
i have discvered stored xss on your website
for protect moonmail
i wrote message explicate the stored xss on facebook moonmail
Contact me if you want me to publish the information publicly

Reorganize the microservice architecture and upgrade to serverless 1.x in the process

Things to re-organize:

  • api
  • events
  • private
  • extensions
  • lists

To be relocated into:

  • lists-microservice
  • emails-microservice
  • campaigns-microservice
  • automations-microservice
  • webbooks-microservice
  • users-microservice
  • templates-microservice
  • support

Since private was a completely different repo, there is a lot of mixed and duplicated code in there. A deep process of de-duplication should be done as well after the integration.

Embed json feeds into template feature request

Hi guys, cool project !

It would be a great idea to add a json feed processing feature for email template to transform the actual content of a json feed into a rendered email.

Use case : personnalized newsletter like Medium

Let's say I have an API that map the id of a suscriber with its interests and return a feed with all the news articles he is interested in and in the MoonMail side I have a recipient field userID.

For example the following url https://myfakenewsapi.com?userId={{userID}}
would return something like this

{
  "categories": [
    {
      "name": "Artificial intelligence",
      "articles": [
        {
          "title": "This is a title",
          "summary": "This an article about artificial intelligence",
          "imageUrl": "https://myurl.com/myimage.jpg"
        }
      ]
    }
  ]
}

For the liquid side it would be something like this (I suppose)

{% for category in news.categories %}
    <p>New in {{ category.name}}</p>
    {% for article in category.articles %}
          <p>{{ article.title }}</p>
          <img src="{{ article.imageUrl}}"</img>
          <p>{{ article.summary}}</p>
    {% endfor %}
{% endfor %}

Set From Name

Set the sender's From Name when sending a campaign

DynamoDB tables are not deleted if stack creation fails

If something goes wrong with creation of the CloudFormation stack via sls resources deploy, the DynamoDB tables are left behind, which will guarantee any subsequent deployment to fail too, as previously noted.

One workaround is to install the AWS CLI and then do something like this (BEWARE: this will delete all your tables!):

profile=moonmail
aws dynamodb list-tables --profile $profile | \
    jq .'TableNames[]' -r | \
    grep -v table_you_dont_want_to_delete | \
    xargs -ITABLE -n 1 \
          aws dynamodb delete-table --table-name TABLE --profile $profile

but it would be nicer if clean-up happened automatically. Since I'm not an AWS expert, I'm not sure whether this is an issue with how the MoonMail app is declared, or an issue with the serverless library, or with CloudFormation itself.

sendTestEmail endpoint

Create an endpoint to send a test email for a given campaign. Behavior:

  • If only the campaignId is included in params, it fetches the campaign from the DB. If there are more params, it performs an update first.
  • Validate properties: presence of subject, body.
  • It will use the default sender.
  • Send an SNS message to the PrecompileEmail Topic

Link 404

README.md

Live demo
If you have set up everything correctly you'll be able to send an email campaign using our demo ui

latest serverless

I'm trying to figure out how to get this to work with the latest serverless, but im unable to find a reliable tut. The older serverless is deprecated and its hard to find answers to questions for the specific version that moonmail requires

Why serverless 0.5 and 1.0?

Is there a specific reason why the install requires serverless 0.5 (as a global install?) and is not getting upgraded to 1.x?

If there is the reason it would be good to have it in the README.

MoonMail Performance

Hello,

Thank you for 'open-sourcing' this wonderful project!
Would you mind sharing MoonMail performance tests?
E.g. how much time does it take to send email to 1M subscribers?

I am sure that performance will be above expected due to well-organized
architecture but it would be also interesting to give us a hint about how
much will be spent on 1M emails (avg. size 20KB) for Lambda and DynamoDB.

Thanks!

sls resources deploy issues

I can't find any documentation that might help me to define these variables:

Serverless: WARNING: This variable is not defined: publicApiARN
Serverless: WARNING: This variable is not defined: awsMarketplaceUserArn
Serverless: WARNING: This variable is not defined: opensReportRCU

Architecture question

I've been looking into this project because the idea of having the whole system be a collection of Lambda functions seems very appealing. As a matter of fact, a few years ago I wrote some software that does pretty much the same as MoonMail does and it is due for an update as some specs have changed. I'm evaluating porting my software to Lambda or just adapting the thing to use MoonMail.

I have the following questions:

  1. In my tests using Serverless, I noticed that when I changed a resource name (like the name of a DynamoDb table) and redeployed, there was no warning and the old table and its contents were destroyed. I think that a simple mistake like an extra character in the config file resulting in the deletion of all data on a database is pretty risky. How do you handle this kind of issue?

  2. Regarding sending email through SES. How do you handle throttling when you reach the sending limit for a particular account? Do you do exponential backoffs? I can't seem to find this in the code base. I'll be very grateful if you could point me in the general area in the repo where this happens.

I do have other questions but I'll wait till I'm more familiar with the repo to ask them.

Thanks!

How to handle SES quota issue

Hi,
You guys do use SES I am sure and as per my experience it first puts new user in Sandbox mode.
So if I upgrade my account to $15 one, will I be able to send millions of emails a month? And if so, will I be using your SES account or mine?

cheerio, cuid, and liquid-nodes deps

 cd MoonMail
 npm install
 sls project init -c -n moonmail
 sls resources deploy
 sls function deploy
 npm install liquid-node --save
 sls function deploy
 npm install cheerio --save
 sls function deploy
 npm install --save cuid
 sls function deploy

The above are commands from a fresh checkout;. I had to jump through a couple hoops to deploy functions. Is this intended behavior? Thanks

Re triggering a Lambda send function

When there is a message in a user SQS queue, an alarm is triggered and an SNS notification starts the Lambda send email process. If the Lambda function throws an exception and does not re-invoke itself again to send the rest of the batch, how do you start the process again? SNS will only send notifications as the alarm state changes but in this case the state will remain the same.

Data-residency and SES Availability

For compliance reasons I'm looking to install MoonMail using Amazon's Canada's (Central) region... Unfortunately SES is NOT available in this region... I'll admit up front I'm an AWS noob, no question (the documentation and UI are... dense)... But that said can anyone tell me if it's possible to install MoonMail and configure it to use the SES service from another region where it is available? Thanks in advance!

listRecipientsHttp function don't work

I jus't deployed a new moonmail app in AWS, things seens to work fine, except the function "listRecipientsHttp"

When I call it I see the following error in my logs:

{
    "message": "Function not found: arn:aws:lambda:us-east-1:187680139068:function:spektrum-moonmail-lists-dev-**searchRecipientsRaw**",
    "code": "ResourceNotFoundException",
    "time": "2018-06-26T18:26:18.012Z",
    "requestId": "6ac99824-796e-11e8-b2e7-11996088f9da",
    "statusCode": 404,
    "retryable": false,
    "retryDelay": 21.785371645320815
}

What is this function "searchRecipientsRaw", I can't see to find it to deploy. I can just deploy "listRecipientsHttp"

Recipients API refactor

Modify table structure: listId as Hash Key and id (Base64 of email) as Range Key. Use moonmail-models

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.