This is a repository that stores multiple email templates. It allows to sent an email based on template and delivered payload.
Basic auth credentials
SERVICE_B_BASIC_AUTH_USERNAME=service_b
SERVICE_B_BASIC_AUTH_PASSWORD=service_b
SMTP settings
SMTP_SERVER=smtp_server
SMTP_PORT=smtp_port
SMTP_USERNAME=smtp_username
SMTP_PASSWORD=smtp_password
Example of the request
POST /template_email_deliveries
{
"template_email": {
"from": "[email protected]",
"to": "[email protected]",
"headers": { "Reply-To": "[email protected]" },
"template_name": "external_urls_request_results",
"template_payload": {
"nickname": "Bombinsky",
"request_id": "1234",
"request_start_time": "2020-07-01 10:45",
"request_end_time": "2020-07-04 10:45",
"request_created_at": "2020-07-05 13:45:34",
"request_updated_at": "2020-07-05 13:55:49",
"urls": [
{ "page_title": "Page title 1", "url": "https://wp.pl" },
{ "page_title": "Page title 2", "url": "https://amazon.com" },
{ "page_title": "Page title 3", "url": "https://youtube.com" }
]
}
}
}-
Set all required environmental variables the way you prefer. For example you can copy then edit .env using .env.example
cp .env.example .env -
Setup connection for postgres. You can copy then edit config/database.yml using config/database.yml.example
cp config/database.yml.example cp config/database.yml -
Setup database with
rails db:setup -
Run application server
rails s
-
Run specs
rspec -
Run specs with code coverage
COVERAGE=true rspecopen tmp/reports/coverage/index.html -
Launch console if needed
rails c -
Check new code with cops during development
pronto run -r=flay rails_best_practices reek rubocop brakeman -c origin/develop -
Run pronto with cops on whole code like
pronto run --commit=$(git log --pretty=format:%H | tail -1)


