Migrate mailgun email templates from one domain to another within the account
- Set required environment variables
- Execute python script
MG_BASE_URL='https://api.mailgun.net/v3' # Mailgun API base URL
MG_OLD_MAIL_DOMAIN='abc.com' # Domain name under which template exists
MG_NEW_MAIL_DOMAIN='xyz.com' # Domain name to which template needs to be copied or moved to
MG_API_KEY='xxxxxxxxxx' # Mailgun API Key
python3 mailgun-template-migration.py [copy | move]