Giter Site home page Giter Site logo

camel-sendgrid's Introduction

SendGrid Component

The sendgrid component supports sending emails with SendGrid.

Prerequisites

You must have a valid SendGrid account.

URI Format


sendgrid://from[?options]

You can append query options to the URI in the following format, ?options=value&option2=value&...

URI Options

The SendGrid component supports 3 options, which are listed below.

Name Description Default Type
configuration (advanced) The SendGrid default configuration SendGridConfiguration
apiKey (producer) SendGrid API Key String
resolveProperty Placeholders (advanced) Whether the component should resolve property placeholders on itself when starting. Only properties which are of String type can use property placeholders. true boolean

The SendGrid endpoint is configured using URI syntax:


sendgrid:from

with the following path and query parameters:

Path Parameters (1 parameters):

Name Description Default Type
from Required The sender's email address. String

Query Parameters (3 parameters):

Name Description Default Type
subject (producer) The subject which is used if the message header 'CamelSendGridSubject' is not present. String
to (producer) Destination email address. Can be overriden with 'CamelSendGridTo' header. String
apiKey (security) API Access Key String
bccAddresses (producer) List of destination bcc addresses. Can be overriden with 'CamelSendGridBcc' header. List

Required SendGrid component options

You have to provide the sendGridClient in the Registry or your apiKey.

Usage

Message headers evaluated by the SendGrid producer

Header Type Description
CamelSendGridFrom String The sender's email address.
CamelSendGridTo String The destination for this email.
CamelSendGridSubject String The subject of the message.
CamelSendGridBcc String List of strings to bcc the email to.

Message headers set by the SendGrid producer

Header Type Description
CamelSendGridMessageId String The SendGrid message ID.

Advanced SendGrid configuration

If you need more control over the SendGrid instance configuration you can create your own instance and refer to it from the URI:

from("direct:start")
.to("sendgrid://[email protected]?sendGridClient=#sendgrid");

The #sendgrid refers to a SendGrid in the Registry.

import com.sendgrid.Client;
import com.sendgrid.SendGrid;
Client client = new Client();
SendGrid sendgrid = new SendGrid(apiKey, client);

registry.bind("sendgrid", sendgrid);

Dependencies

sendgrid-java

See Also

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.