This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"StartAt": "translateTask", | |
"Comment": "exportNotes workflow.", | |
"Version": "1.0", | |
"States": { | |
"translateTask": { | |
"Type": "Task", | |
"Resource": "arn:aws:lambda:x:x:function:translate", | |
"Next": "adapter", | |
"InputPath": "$.translateInput", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"StartAt": "translateTask", | |
"Comment": "exportNotes workflow.", | |
"Version": "1.0", | |
"States": { | |
"translateTask": { | |
"Type": "Task", | |
"Resource": "arn:aws:lambda:x:x:function:translate", | |
"Next": "sendMailTask", | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.handler = async (event) => { | |
const translation = await translate(event.text, event.language); | |
return { text: translation }; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.handler = async (event) => { | |
const notes = await getNotes(user.id); // Fetch user notes from database. | |
const translatedNotes = await translate(notes, event.translateTo); // Translate notes to target language. | |
await sendMail(user.email, "Your notes", translatedNotes); // Send translated notes to user. | |
return { message: "You will receive the email soon" }; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.handler = async (event) => { | |
await sendMail(event.to, event.subject, event.message); | |
return { success: true }; | |
}; |
NewerOlder