Adding current date in Jenkins email - email

I am sending an email after my build in jenkins job and I am using HTML for construction of email content, now I want to be able to add - current date in 'DEFAULT CONTENT' i.e Email content and also into the 'Subject' line of the email.
However
In case of 'DEFAULT CONTENT' - without using Javascript I am unable to find a way.
and I have no idea how can I achieve this in 'Subject' line of the email.
Any help ?!

You can use Build Timestamp Plugin to retrieve the build timestamp and export it to an environment variable and then you can use the variable in your e-mail subject line.

It is possible without installing any plugin, but be sure that your jenkins instance is running the right date, to be sure type date in your shell.
Then go on your jenkins job
in Execute shell panel :
date > timestamp.txt
Then in the Editable Email Notification panel , in Default Content section :
${FILE,path="./timestamp.txt"}

Related

Woocommerce Custom Email path in Plugin

I create a custom order status and the . also cerated a custom email that are fired manually when the status is changed to my new custom status.
It works 100% if my custom email template reside in plugins/woocommerce/
\plugins/woocommerce/templates/emails/logistics-eft-paid.php
But i need to add the custom email to my childtheme.
themes/ms-store/woocommerce/emails/logistics-eft-paid.php
I used this plugin, and I realise that woocommerce_get_template is outdated and replaced by wc_get_template, but is simply can't get it to work.
Even if I can hardcode the path to the email template, it will be a start.
Plugin used:
https://github.com/skyverge/woocommerce-expedited-order-email
Any help will be appreciated,
Thank you.

How to define a list of emails for the job notification plugin in Jenkins

This is for the Notification Plugin (link here) for Jenkins.
I have a bunch of Jenkins jobs that I want to keep an eye on. I want to be alerted/emailed when any changes are made to a job so the job notification plugin should be helpful. This plugin adds a subsection to each Jenkins job for us to configure. We have to check the checkbox and enter email addresses for each job to notify us whenever there's a change.
I want to define some environment variable that contains emails so I don't have to go into each job to add/delete email addresses for interested parties; that I can just add/delete addresses from this variable. Can someone tell me how to do this or am I out of luck and the field only takes email addresses and not variables containing email addresses.
Screenshots from my Jenkins:
Global variables defined in Jenkins:
Field in Jenkins job notification heading that doesn't allow me to enter a variable for emails:
This appears to be fixed in version 2.144 (both "${DEFAULT_RECIPIENTS}" and "$DEFAULT_RECIPIENTS" reference the global property fine in the "Recipients" field).
Otherwise, I use the Email Extension Plugin ("Email-ext") for much more flexibility.
Once installed, to configure the plugin, navigate to Jenkins -> Manage Jenkins -> Configure System, and scroll down to "Extended E-mail Notification".
There you can set the global defaults, such as "Default Recipients".
These settings are assigned to tokens, such as "$DEFAULT_RECIPIENTS".
Click the "?" button for each setting and note the token name.
Note the "cc:" and "bcc:" prefixes to put an address on "cc" or "bcc").
Then, in your job configuration (/job/myJobName/configure):
Go to "Post-build Actions"
Click "Add post-build action" and select "Editable Email Notification".
Ensure that "$DEFAULT_RECIPIENTS" is in the "Project Recipient List", with any other addresses (note the "cc:" prefix to put addresses on "cc").
Click on the "Advanced settings" (bottom left of the "Editable Email Notification" configuration) to show the "Triggers" section and configure emails depending on the build status, like "Always", "Failure", etc...). Click the "Advanced" button for each trigger to get more options.
Once this setup is done, you can edit the global "$DEFAULT_RECIPIENTS" to change the emailing for all jobs configured as above, and have the functionality you require.
PS: I know this is old, I hope my answer may help others - like me - that have the same question.
I've been trying to follow a similar approach as that of yours, with the only difference of having a job parameter being assigned the recipient's address.
I encountered a problem where the plugin wasn't able to parse the job/environment variable to it's assigned value (the email address).
For example,
emailID=xxxxxx#yyyyy.com
Now this particular variable was being sent into the emailing list as ${emailID} and not as xxxxxxx#yyyyyy.com
The fix? Really funny.
Your variable must be the first comma seperated value in the mailing list.
You can refer to the attached image below.
As you can see, just keep the variable first, and then your predefined values or the plugin's variables

Jenkins editable email notification attachment : Mail going without attachment

The jenkins editable email notification in sending the mail but without the attachment.The attachment is in the workspace of jenkins.Path of attachment jenkins\workspace\projectname\test.csv.In the Attachments field of the editable email notification i am specifying projectname/test.csv but the attachment is not getting send.
I have also tried **/projectname/test.csv ,**/test.csv , /projectname but nothing seems to work.
PS: File size is about 10MB.
Can you use the "Email-ext plugin". more information is available here : https://wiki.jenkins-ci.org/display/JENKINS/Email-ext+plugin
I used a added a execute shell to the build moving (cd) to the directory of the file and then coping (cp) the file to the workspace directory, i them rename (mv) it and then attach it.

Magento translation email - email titles

How do you go about changing the title of emails in a second language store view. Example "New Order" in the New Order confirmation email. csv files are not responding in this case...
Another solution. You can copy the default email templates into a language folder you are wanting to use, and translate them manually.
Copy everything in app/locale/en_US/template to app/locale/[YOUR
LANGUAGE CODE]/template.
Change [YOUR LANGUAGE CODE] to the Language Code of your
desired language. YOu can find a list here. Make sure it's in
the format en_US.
Modify the email templates in your app/locale/[YOUR
LANGUAGE CODE]/template folder.
In Magento, go to System > Configuration > General. At the top left, change your Current Configuration Scope: to the store you want translated.
Change the Locale to the language you translated to. It must match correct the language code used in your folder namespace.
NOTE: When editing the email template files, you'll notice some comments at the top containing variables and such. You will see something like <!--#subject Welcome, {{var customer.name}}! #-->. Changing this will alter the subject line used by Magento.
You can just create custom Transactional Emails which include the translations needed for the store view.
Create a new Transaction Email template, in your store's required
language. Go to System > Transactional Emails and click Add New
Template. Load in the default template you are trying to
translate and modify the subject and body of the email.
Go to System > Configuration > Sales Emails At the top left of your configuration, change to your desired Store View you want these emails to be assigned to.
Change the New Order Confirmation Template to the Transaction Email template you created. Click Save Config.
Items ordered from that store should now send an email using the translated email you created.

Expression Engine using the Champagne Extension troubleshooting

I have an issue in Expression Engine using the Champagne Extension where it won't allow me to send out campaigns. This extension utilizes https://www.campaignmonitor.com/ api to send out mass emails.
The Error I get is "HTML Content URL Required" when I try to send out campaigns form the back end of the Expression Engine Install.
What could be causing this issue that relates to the expression engine install?
This error is received anytime the URL to your html or text content is not visible. More often this is seen when someone forget to include the text version. A good way to test is to click the preview HTML/TEXT button and make sure both give you the correct results.
They cannot be blank.
For an alternative solution, be sure to checkout my add-on Postmaster. It allows clients to publish email campaigns just by creating a new entry. You can setup any number of configuration, so you can even send draft email to a test subscriber list. And since everything is within channel entries, you can use whatever fieldtypes you like, and it works with MailChimp as well as CampaignMonitor.
https://objectivehtml.com/articles/postmaster-the-definitive-email-solution-for-expressionengine