Skip to content

Instantly share code, notes, and snippets.

@garlou
garlou / index.ts
Created Apr 7, 2021
Send raw email with attachment with AWS SES using Typescript
View index.ts
/*
* This solution was built based on stackoverflow answer https://stackoverflow.com/a/54233102
* placed by user https://stackoverflow.com/users/2485910/snowball
*/
import AWS from 'aws-sdk';
import {Template} from 'aws-sdk/clients/ses';
interface Attachment {
encoding: 'base64';
View application_controller.rb
def ensure_clinician_is_logged_in
respond_to do |format|
format.html { redirect_to "/clinicians/sign_in#{build_url_query}" unless current_clinician }
format.json do
response.headers['REQUIRES_AUTH'] = '1'
render js: "/clinicians/sign_in#{build_json_query}" unless current_clinician
end
end
end