How to use the @sendgrid/client.request function in @sendgrid/client

To help you get started, we’ve selected a few @sendgrid/client examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Coding-Coach / find-a-mentor-api / src / modules / email / email.service.ts View on Github external
list_ids: [EmailService.LIST_IDS.MENTORS],
        contacts: [
          {
            email: contact.email,
            first_name: contact.name,
            country: contact.country,
            custom_fields: {
              // We can clean our list in SG with this field
              e2_T: isProduction ? 'production' : 'development',
            },
          },
        ],
      }),
    };

    return await sgClient.request(request);
  }
}
github NoQuarterTeam / split / packages / api / src / lib / mailer.ts View on Github external
async sendDev(args: MailArgs) {
    const request = {
      method: "GET",
      url: `/v3/templates/${args.templateId}`,
    }
    const [template] = await sendgridClient.request(request)
    const version = template.body.versions[template.body.versions.length - 1]
    const html = this.interpolateVariables(args.variables, version.html_content)
    const subject = version.subject
    const text = this.interpolateVariables(
      args.variables,
      version.plain_content,
    )
    this.devMail.sendMail({
      to: args.to,
      from: this.from,
      subject,
      html,
      text,
    })
  }
github iotexproject / iotex-explorer / src / server / gateways / get-sendgrid.ts View on Github external
sendgrid.addSubscription = async (
    email: string
  ): Promise<[ClientResponse, any]> => {
    request.body = [{ email }];
    return client.request(request);
  };

@sendgrid/client

Twilio SendGrid NodeJS API client

MIT
Latest version published 1 month ago

Package Health Score

95 / 100
Full package analysis