Skip to content

Commit

Permalink
Merge pull request #63 from gitvchandra/master
Browse files Browse the repository at this point in the history
subscription notification message changes
  • Loading branch information
ozzambra authored Mar 8, 2023
2 parents 81e976b + 7eefb89 commit eb86a26
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/grant-revoke-access-to-product.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ exports.dynamodbStreamHandler = async (event, context) => {

if (grantAccess) {
subject = 'New AWS Marketplace Subscriber';
message = `Grant access to new SaaS customer: ${JSON.stringify(newImage)}`;
message = `subscribe-success: ${JSON.stringify(newImage)}`;
} else if (revokeAccess) {
subject = 'AWS Marketplace customer end of subscription';
message = `Revoke access to SaaS customer: ${JSON.stringify(newImage)}`;
message = `unsubscribe-success: ${JSON.stringify(newImage)}`;
} else if (entitlementUpdated) {
subject = 'AWS Marketplace customer change of subscription';
message = `New entitlement for customer: ${JSON.stringify(newImage)}`;
message = `entitlement-updated: ${JSON.stringify(newImage)}`;
}

const SNSparams = {
Expand Down
3 changes: 2 additions & 1 deletion src/subscription-sqs.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ exports.SQSHandler = async (event) => {
Key: {
customerIdentifier: { S: message['customer-identifier'] },
},
UpdateExpression: 'set successfully_subscribed = :ss, subscription_expired = :se, is_free_trial_term_present = :ft',
UpdateExpression: 'set subscription_action = :ac, successfully_subscribed = :ss, subscription_expired = :se, is_free_trial_term_present = :ft',
ExpressionAttributeValues: {
':ac': { S: message['action'] },
':ss': { BOOL: successfullySubscribed },
':se': { BOOL: subscriptionExpired },
':ft': { BOOL: isFreeTrialTermPresent}
Expand Down

0 comments on commit eb86a26

Please sign in to comment.