Change From Value on Cron Email

Certainly! To update a cron task and customize the email sent from it, you can use the following command with the <CRON COMMAND> replaced by your actual command:

1
<CRON COMMAND> | mail -E -s "Subject" -r "CUSTOM FORM NAME <[email protected]>"

This command will execute <CRON COMMAND> and send the output as an email with the specified subject and sender address.

Here’s a breakdown of the command:

  • <CRON COMMAND>: Replace this with the actual command you want to run on a schedule using cron.

  • mail: This is the command used to send an email.

  • -E: This option ensures that the email is not sent if the content is empty.

  • -s "Subject": This sets the subject of the email to “Subject.” Replace “Subject” with your desired email subject.

  • -r "CUSTOM FORM NAME <[email protected]>": This sets the sender address and name. Replace “CUSTOM FORM NAME” with the desired sender name, and “[email protected]” with the sender’s email address.

After updating your cron task with this command, it will send emails with the specified customization.

0%