Skip to content

Instantly share code, notes, and snippets.

@Mattias-
Created September 21, 2020 16:31
Show Gist options
  • Save Mattias-/5425d18c362a4a576fa387722e77a99e to your computer and use it in GitHub Desktop.
Save Mattias-/5425d18c362a4a576fa387722e77a99e to your computer and use it in GitHub Desktop.
#!/bin/bash
# This is a script that unsubscribes an email address from AWS junk mail.
# If the script breaks it might be the magic numbers that needs to change.
# Send the form while tracing the request in your browser to find the new values.
# https://pages.awscloud.com/communication-preferences
unsubscribe_aws_email() {
curl "https://pages.awscloud.com/index.php/leadCapture/save2" \
-H "Accept: application/json" \
--data-urlencode "Email=$1" \
--data "preferenceCenterCategory=no" \
--data "preferenceCenterGettingStarted=no" \
--data "preferenceCenterOnlineInPersonEvents=no" \
--data "preferenceCenterMonthlyAWSNewsletter=no" \
--data "preferenceCenterTrainingandBestPracticeContent=no" \
--data "preferenceCenterProductandServiceAnnoucements=no" \
--data "preferenceCenterSurveys=no" \
--data "PreferenceCenter_AWS_Partner_Events_Co__c=no" \
--data "preferenceCenterOtherAWSCommunications=no" \
--data "Unsubscribed=yes" \
--data "UnsubscribedReason=Too%20many%20emails" \
--data "zOPEmailValidationHygiene=validate" \
--data "formVid=34006" \
--data "formid=34006" \
--data "lpId=127906" \
--data "subId=6"
}
unsubscribe_aws_email "$1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment