diff --git a/docs/INSTALL.md b/docs/INSTALL.md index faca21e..ea4bed2 100644 --- a/docs/INSTALL.md +++ b/docs/INSTALL.md @@ -106,6 +106,7 @@ add email notifications for payments and fund receipt `AWS_SES_ID=..."` (settings table) `AWS_SES_SECRET=..."` (settings table) `AWS_SES_EMAIL_FROM=..."` (settings table) +`AWS_REGION=...` (settings table) `FUNCTION_EMAIL=ENABLE"` (settings table) `cards.email_address='card.notifications@yourdomain.com'` `cards.email_enable='Y'` diff --git a/docs/SETTINGS.md b/docs/SETTINGS.md index e42df0b..d3909a9 100644 --- a/docs/SETTINGS.md +++ b/docs/SETTINGS.md @@ -26,6 +26,7 @@ Here are the descriptions of values available to use in the `settings` table: | AWS_SES_ID | | Amazon Web Services - Simple Email Service - access id | | AWS_SES_SECRET | | Amazon Web Services - Simple Email Service - access secret | | AWS_SES_EMAIL_FROM | | Amazon Web Services - Simple Email Service - email from field | +| AWS_REGION | us-east-1 | Amazon Web Services - Account region | | EMAIL_MAX_TXS | | maximum number of transactions to include in the email body | | FUNCTION_LNDHUB | DISABLE | system level switch for using LNDHUB in place of LND | | LNDHUB_URL | | URL for the LNDHUB service | diff --git a/email/email.go b/email/email.go index 8f78ddd..7b56a88 100644 --- a/email/email.go +++ b/email/email.go @@ -92,9 +92,10 @@ func Send_email(recipient string, subject string, htmlBody string, textBody stri aws_ses_id := db.Get_setting("AWS_SES_ID") aws_ses_secret := db.Get_setting("AWS_SES_SECRET") sender := db.Get_setting("AWS_SES_EMAIL_FROM") + region := db.Get_setting("AWS_REGION") sess, err := session.NewSession(&aws.Config{ - Region: aws.String("us-east-1"), + Region: aws.String(region), Credentials: credentials.NewStaticCredentials(aws_ses_id, aws_ses_secret, ""), }) diff --git a/sql/settings.sql b/sql/settings.sql index 75b7dd1..730ac0e 100644 --- a/sql/settings.sql +++ b/sql/settings.sql @@ -23,6 +23,7 @@ INSERT INTO settings (name, value) VALUES ('FUNCTION_EMAIL', ''); INSERT INTO settings (name, value) VALUES ('AWS_SES_ID', ''); INSERT INTO settings (name, value) VALUES ('AWS_SES_SECRET', ''); INSERT INTO settings (name, value) VALUES ('AWS_SES_EMAIL_FROM', ''); +INSERT INTO settings (name, value) VALUES ('AWS_REGION', 'us-east-1'); INSERT INTO settings (name, value) VALUES ('EMAIL_MAX_TXS', ''); INSERT INTO settings (name, value) VALUES ('FUNCTION_LNDHUB', ''); INSERT INTO settings (name, value) VALUES ('LNDHUB_URL', '');