Guides Getting Started
Running your first automation with MessageJay
MessageJay supports running hand written code as well as prompting an AI to generate the automation for you.
This prompt shows how you can generate an automation that checks an e-mail for specific content and sends an response:
When an email arrives,
check if the text content contains "hello, world", ignoring casing and
if the text is found, send a response with the content "Hello, World!"
If you need more control over the automation, you can write the code by hand. This minimal example shows how you can check an e-mail for specific content and send an response:
import * as runtime from "./runtime";
const integrations = {} as const;
// Write your code below this line
async function main(): Promise<void> {
const { email } = await runtime.getParameters();
if(email.text.toLowerCase().includes("hello, world")) {
await email.reply({
text: "Hello, World!"
});
}
}
runtime.start(main);