0

When campaign sending process is fired up, AttachRecipientsService publish to SNS with the topic "ATTACH_SENDER_TOPIC_ARN". However, there is no subscriber to this action in AWS / MoonMail. Any idea how the "ATTACH_SENDER" is handled?

It is not possible to send a campaign without this information.

As noted here: https://github.com/microapps/MoonMail/wiki/Campaigns

Users service will get the message and attach a sender object, with the actual sender credentials in case he’s able to send the campaign (pushing the message to the PrecompileCampaign topic), or will drop the message to the campaign errors topic.

But there is no Users service. Any idea?

Frank T
  • 8,268
  • 8
  • 50
  • 67
Gabriel Robert
  • 3,012
  • 2
  • 18
  • 36

2 Answers2

1

Users service is not open sourced, but you can take a look at the sendTestCampaign function. If you provide it with a campaign and sender object it basically delivers an SNS message to the PrecompileCampaign topic straight away.

davids
  • 6,259
  • 3
  • 29
  • 50
  • Would be nice to make this information available in your wiki :) https://github.com/microapps/MoonMail/wiki/Campaigns Thank you for your help! – Gabriel Robert Apr 19 '17 at 17:50
0

I replaced users service by sending a SNS event to the "PRECOMPILE_CAMPAIGN_TOPIC_ARN".

events\lib\attach_recipients_count_service.js

 _publishToSns(canonicalMessage) {
        debug('= AttachRecipientsService._publishToSns', canonicalMessage);
        const params = {
          Message: JSON.stringify(canonicalMessage),
          TopicArn: process.env.PRECOMPILE_CAMPAIGN_TOPIC_ARN
        };
        return this.snsClient.publish(params).promise()
          .then(() => canonicalMessage);
      }

Make sure that the canonicalMessage contains "sender" object:

"sender": {
    "region": "...",
    "apiKey": "...",
    "apiSecret": "...",
    "ratePerSecond": "...",
    "emailAddress": "...",
    "fromName": "..."
  }
Gabriel Robert
  • 3,012
  • 2
  • 18
  • 36