2017 © Pedro Peláez
 

symfony-bundle sendgrid-symfony

Bundle used to send mail by Sendgrid

image

crs/sendgrid-symfony

Bundle used to send mail by Sendgrid

  • Monday, December 18, 2017
  • by sbsanjaybharti
  • Repository
  • 1 Watchers
  • 0 Stars
  • 9 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

SendGrid-Symfony

Sending Mail with sendgrid, (*1)

Table of Contents

, (*2)

Installation:

Install Package

Add CRS/SendGridBundle to your composer.json file., (*3)

{
  "require": {
    "crs/sendgrid-symfony": "~1.0"
  }
}

Add path in appKernel.php in bundle variable., (*4)


$bundles = [ .... .... .... new CRS\SendgridBundle\SendGridBundle(), ];

Alternative: Install package from cmd

    composer require crs/sendgrid-symfony

Quick Start:

Add configuration to your config.yml file, (*5)

#SendGrid API Access
send_grid:
    key: "%send_grid_key%"
    status: "%send_grid_status%"

How to send the mail:, (*6)

   $sendmail = new crs_mail();
   $sendmail->setFrom(<%SENDER-EMAIL%>);
   $sendmail->setTo(<%RECIPIENTS-EMAIL%>);
   $sendmail->setSubject(<%EMAIL-SUBJECT%>);
   $sendmail->setBody(<%EMAIL-BODY%>);
   $sendmail->setTemplate(<%TEMPLATE-ID%>);
   $sendmail->setSubsitute(array(
       '<%SUBSITUTE-1%>' => <%SUBSITUTE-1-VALUE%>,
       '<%SUBSITUTE-2%>' => <%SUBSITUTE-2-VALUE%>,
       .....
       '<%SUBSITUTE-n%>' => <%SUBSITUTE-n-VALUE%>,
   ));
   $sendmail->addAttachment(array(
       <%FILE-PATH-1%>,
       <%FILE-PATH-2%>,
       .......
       <%FILE-PATH-n%>,
   ));
   $sendmail->sendMail(<%CONTENT-TYPE%>);

, (*7)

Use Cases

  • In upper code with your value
  • To send plain mail replace with 'text/plain'
  • To send html mail replace with 'text/html'
  • Subsitue is used for replacing value used in your email for example in your email content then your will be USERNAME and will be the actual user name.
  • is used for file path for attachment you can add singel or multiple file total size of your mail should not be more that 30MB
  • If there is no any attachment or substitute then you can avoid them.

The Versions

18/12 2017

dev-master

9999999-dev

Bundle used to send mail by Sendgrid

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sanjay

18/12 2017

dev-development

dev-development

Bundle used to send mail by Sendgrid

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sanjay

18/12 2017

v1.1.0

1.1.0.0

Bundle used to send mail by Sendgrid

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sanjay

18/12 2017

v1.0.3

1.0.3.0

Bundle used to send mail by Sendgrid

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sanjay

17/12 2017

v1.0.2

1.0.2.0

Bundle used to send mail by Sendgrid

  Sources   Download

MIT

The Requires

  • php >=5.5.9

 

The Development Requires

by Sanjay

17/12 2017

v1.0.1

1.0.1.0

Bundle used to send mail by Sendgrid

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sanjay

17/12 2017

v1.0.0

1.0.0.0

Bundle used to send mail by Sendgrid

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sanjay