sandiegojs / sdjs-speaker-pipeline

Web application to apply a workflow for organizing speakers for events.
MIT License
2 stars 30 forks source link

SendGrid Information #134

Open BladeSe7en opened 5 years ago

BladeSe7en commented 5 years ago

SendGrid Setup: To setup SendGrid you first need to create a SendGrid account at https://sendgrid.com. Once you have an account you need to create two email templates for the app. One template for sending emails to admins and speakers, and another for the speaker email reminder.

This is the template for speaker and admin emails. Once your template is created copy the template ID into your env file and replace the the templateId variable with the process.env.ADMIN_SPEAKER_EMAIL_TEMPLATE in the following functions found in ../server/utils/sendGridEmailer.js sendEmailToSpeaker sendEmailToAdmin sendConfirmCancelToAdmin sendEmailToNewAdmin

    <head>
      <title>SDJS Meetup</title>
    </head>
    <body>
      <div style='
    align-items: center;
    background-image: linear-gradient(180deg, rgba(24, 132, 195, .64), rgba(24, 132, 195, .64)), url(https://tinyurl.com/ycn372dv);
    background-position: 0px 0px, 0px 38%;
    background-size: auto, cover;
    background-repeat: no-repeat;
    color: white;
    display: flex;
    flex-direction: column;
    margin-left: 0;
    margin-right: 0;'>
      <img className='logo' src='https://tinyurl.com/yb9xzoo5' style="height: 60px;"/>
        </div>
          <p>
              {{emailContent}}
          </p>
    </body>
    </html>

This is the template for the email reminder. Replace the processs.env.SPEAKER_REMINDER_EMAIL_TEMPLATE for the templateId variable for the onTime function found in ../server/utils/sendGridEmailer.js

    <head>
      <title>SDJS Meetup</title>
    </head>
    <body style ='background-color: rgba(24, 132, 195, .2)'>
      <div style='
    align-items: center;
    background-image: linear-gradient(180deg, rgba(24, 132, 195, .64), rgba(24, 132, 195, .64)), url(https://tinyurl.com/ycn372dv);
    background-size: auto, cover;
    background-repeat: no-repeat;
    color: white;
    display: flex;
    flex-direction: column;
    margin-left: 0;
    margin-right: 0;'>
      <img className='logo' src='https://tinyurl.com/yb9xzoo5' style="height: 60px;"/>
        </div>
        <h1 style='
        text-align: center; 
        margin-right: auto; 
        margin-left: auto;'
        >{{title}}</h1>
          <p style='
        text-align: center; 
        margin-right: auto; 
        margin-left: auto;'>
           {{emailContent}}
          </p>
                    <div style='display: flex;justify-content:center'>
                      <button style= '
                      {{sdjsBtn}} ? { display: "block" } : { display: "none" }
                      padding: 11px 30px;
                      font-size: 15px;
                      line-height: 16px;
                      text-align: center;
                      text-decoration: none;
                      vertical-align: middle;
                      cursor: pointer;
                      border-style: solid;
                      border-width: 1px;
                      border-radius: 2px;
                      box-sizing: border-box;
                      transition: color .3s,background-color .3s,border-color .3s;
                      color:#f7f7f7;
                      background-color: #1884c3;
                      margin: 30px;'>
                         <a href={{url}} 
                         style='
                         text-decoration: none;
                         color: white'
                         >VISIT SDJS</a>
                      </button>

                    </div>
    </body>
    </html>
aerze commented 5 years ago

Needs a Sendgrid admin to up date sendgrid account