N
Novu8mo ago
Todd H.

email attachment SDK documentation

Where can I find detailed docs on how to use email attachments via the API or SDK? I found a brief example here using Node. But I need more. https://docs.novu.co/content-creation-design/layouts#override-layout-on-trigger
Novu
Layouts - Novu
Explore how to create and manage layouts in Novu
5 Replies
Ask Inkeep
Ask Inkeep8mo ago
Hi @Todd H., I'm an AI assistant for Novu. While a team member reviews this question, I'll see if I can find relevant sources for your question. ----------------------------- While I generate an answer, here are some sources that might be helpful: * Layouts * Mailersend * SendGrid * Sendinblue -----------------------------
Ask Inkeep
Ask Inkeep8mo ago
Answer For more detailed documentation on handling email attachments via the Novu API or SDK using Node.js, you can refer to the following example from the official Novu documentation. This snippet demonstrates how to send attachments in an email using the Novu Node SDK:
import { Novu } from '@novu/node';
const novu = new Novu('<NOVU_API_KEY>');
novu.trigger('<WORKFLOW_TRIGGER_IDENTIFIER>', {
to: {
subscriberId: '<SUBSCRIBER_ID>',
},
payload: {
attachments: [
{
file: fs.readFileSync(__dirname + '/data/novu.jpeg'),
name: 'novu.jpeg',
mime: 'image/jpeg',
},
],
},
});
import { Novu } from '@novu/node';
const novu = new Novu('<NOVU_API_KEY>');
novu.trigger('<WORKFLOW_TRIGGER_IDENTIFIER>', {
to: {
subscriberId: '<SUBSCRIBER_ID>',
},
payload: {
attachments: [
{
file: fs.readFileSync(__dirname + '/data/novu.jpeg'),
name: 'novu.jpeg',
mime: 'image/jpeg',
},
],
},
});
(1) This example showcases how to include an attachment in the payload when triggering an email-based workflow. For additional parameters and advanced usage, you might want to explore the comprehensive API and SDK documentation on the Novu website or refer directly to the provided documentation links in the SDK repositories.
Ask Inkeep
Ask Inkeep8mo ago
Got it. Tagging @Support for additional help.
Dima Grossman
Dima Grossman8mo ago
@Todd H. do you have any specific requirements you are missing?
Todd H.
Todd H.OP8mo ago
Are there docs for other languages such as Java, Node, Python, TypeScript, etc.? We are self hosting Novu on a k8s cluster. Where do the files need to be located to upload them? __dirname is vague. How can we send an attachment via the API?
Want results from more Discord servers?
Add your server