Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Render function hangs when executing in lambda #230

@iMokhonko

Description

@iMokhonko

Hey, i have a nest.js project where I import built templates and render them inside.

When I run my app locally it properly renders them into HTML and text. when i build this project and deploy to lambda it hangs when i try to render template file. No errors inside cloudwatch logs.

Can someone help me with this issue, am I doing something wrong?

Here is some code:

import { render } from '@vue-email/render';
....

async sendEmail({
    to,
    subject,
    template: { templateFile, props },
    source = `.....`,
  }: SendEmailParams) {
    const [html, text] = await Promise.all([
      render(templateFile, props),
      render(templateFile, props, { plainText: true })
    ]);

    const sendEmailCommandParams: SendEmailCommandInput = {
      Destination: { ToAddresses: [to] },
      Source: source,
      Message: {
        Subject: { Charset: 'UTF-8', Data: subject },
        Body: {
          Html: { Charset: "UTF-8", Data: html },
          Text: { Charset: "UTF-8", Data: text } 
        },
      },
    };
  
    const sendEmailCommand = new SendEmailCommand(sendEmailCommandParams);
    try {
      return await this.client.send(sendEmailCommand);
    } catch(e) {
      console.error(e)
    }
  }
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions