Merge pull request #55 from MizukiSonoko/aws-region-uses-db-settings

Make Aws Region uses db settings
This commit is contained in:
Peter Rounce 2023-04-22 10:10:00 +01:00 committed by GitHub
commit 6cabfbf0d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 1 deletions

View file

@ -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'`

View file

@ -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 |

View file

@ -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, ""),
})

View file

@ -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', '');