Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Email Notifications #9

Closed
gep13 opened this issue Nov 3, 2016 · 2 comments
Closed

Add support for Email Notifications #9

gep13 opened this issue Nov 3, 2016 · 2 comments
Assignees
Labels
Milestone

Comments

@gep13
Copy link
Member

gep13 commented Nov 3, 2016

No description provided.

@gep13 gep13 added the Feature label Nov 3, 2016
@gep13 gep13 added this to the 0.3.0 milestone Nov 3, 2016
@gep13 gep13 modified the milestone: 0.3.0 Jan 26, 2017
@gep13 gep13 added this to the 2.0.0 milestone Sep 9, 2019
@Jericho Jericho self-assigned this Sep 9, 2019
@Jericho
Copy link
Member

Jericho commented Sep 12, 2019

In case of a successful build, the email will look like this:
image

When a problem occurs during build, the email will look like this:
image

@Jericho
Copy link
Member

Jericho commented Sep 12, 2019

To enable this, you will have to configure the following 5 environment variables

  • EMAIL_SMTPHOST: the address of your SMTP server. For example, if you want to use Google's server you would specify "smtp.gmail.com".
  • EMAIL_PORT: the IP port that your SMTP server is listening to. Typically SMTP servers are configured on port 25. Google's SMTP server, as an example, listens to port 465.
  • EMAIL_ENABLESSL: this string value must contain the value "true" or "false" to indicate whether your SMTP server requires SSL connection. Google's SMTP server for instance requires SSL connection, therefore you would set this variable to "true" if you wanted to use this SMTP server.
  • EMAIL_USERNAME: this is the username that authenticates you with the SMTP server.
  • EMAIL_PASSWORD: this is the password associated with the username you previously specified.

You also also must provide the following 3 parameters in your recipe.cake file:

  • emailRecipient: the email address where the message will be sent. This can either be a single address or multiple addresses separated by a comma.
  • emailSenderName: the name of the sender. This value is displayed to the recipient by their email client.
  • emailSenderAddress: the email address of the sender. This is where replies will be sent.

Here is a code sample demonstrating how to specify these three values in your recipe.cake:

BuildParameters.SetParameters(context: Context,
    buildSystem: BuildSystem,
    sourceDirectoryPath: "./Source",
    title: "Cake.MyAddin",
    repositoryOwner: "cake-contrib",
    repositoryName: "Cake.MyAddin",
    appVeyorAccountName: "cakecontrib",
    emailRecipient: "myself@example.com,someoneelse@example.com",
    emailSenderName: "Cake Script",
    emailSenderAddress: "donotreply@example.com",
    shouldRunGitVersion: true);

gep13 pushed a commit that referenced this issue Sep 13, 2019
gep13 pushed a commit that referenced this issue Sep 13, 2019
gep13 pushed a commit that referenced this issue Sep 13, 2019
gep13 pushed a commit that referenced this issue Sep 13, 2019
gep13 pushed a commit that referenced this issue Sep 13, 2019
gep13 pushed a commit that referenced this issue Sep 13, 2019
gep13 added a commit that referenced this issue Sep 13, 2019
* pr399:
  Formatting
  (GH-9) Remove environment variables that are no longer necessary
  (GH-9) Allow sender info to be passed to the helper method
  (GH-9) Move sender information to parameters (rather than credentials)
  (GH-9) Better formatting in the email
  (GH-9) Send email during teardown
  (GH-9) Add the SendEmail helper method
  (GH-9) Make StandardMessage a public parameter instead of private and add a parameter for email recipient
  (GH-9) Add parameter to control whether email notifications can/should be sent
  (GH-9) Email credentials
  (GH-9) Reference the Cake.Email addin
  (GH-9) Add environment variables for SMTP authentication
  Reduce code duplication
@gep13 gep13 closed this as completed Sep 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants