# Email notification message body contents

**URL:** <https://community.openpbs.org/t/email-notification-message-body-contents/2077>\
**Category:** Users/Site Administrators\
**Created:** [April 15, 2020, 2:38pm UTC](https://community.openpbs.org/t/email-notification-message-body-contents/2077 "2020-04-15T14:38:29Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![blacksburgturkey](https://avatars.discourse-cdn.com/v4/letter/b/c68b51/32.png) [@blacksburgturkey](https://community.openpbs.org/u/blacksburgturkey)\
**Post date:** [April 15, 2020, 2:38pm UTC](https://community.openpbs.org/t/email-notification-message-body-contents/2077/1 "2020-04-15T14:38:29Z")

</div>

I have PBS set to send emails at beginning and end of a job submission.

The default content of those emails is as follows:  
Body of first email…  
PBS Job Id: 10.pbs01  
Job Name: STDIN  
Begun execution

Body of email at end of job…  
PBS Job Id: 10.pbs01  
Job Name: STDIN  
Execution terminated  
Exit\_status=0  
resources\_used.cpupercent=0  
resources\_used.cput=00:00:00  
resources\_used.mem=5600kb  
resources\_used.ncpus=1  
resources\_used.vmem=408320kb  
resources\_used.walltime=00:00:22

I’d like to customize the body of each of these emails to also include the “exec\_host =” value(s). Is it possible for me to add this information? If so, how?

Thanks  
Blacksburgturkey

---

<div class="post-metadata">

**Author:** ![adarsh](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@adarsh](https://community.openpbs.org/u/adarsh)\
**Post date:** [April 16, 2020, 8:14pm UTC](https://community.openpbs.org/t/email-notification-message-body-contents/2077/2 "2020-04-16T20:14:43Z")

</div>

We cannot customise this . The default content would remain the same.  
However, you can use the pure epilogue script or Mom hook events (execjob\_epilogue/execjob\_end) to send customized mail.

---

<div class="post-metadata">

**Author:** ![blacksburgturkey](https://avatars.discourse-cdn.com/v4/letter/b/c68b51/32.png) [@blacksburgturkey](https://community.openpbs.org/u/blacksburgturkey)\
**Post date:** [April 17, 2020, 3:16pm UTC](https://community.openpbs.org/t/email-notification-message-body-contents/2077/3 "2020-04-17T15:16:46Z")

</div>

Thanks for this information.

---

<div class="post-metadata">

**Author:** ![datakid](https://avatars.discourse-cdn.com/v4/letter/d/db5fbb/32.png) [@datakid](https://community.openpbs.org/u/datakid)\
**Post date:** [September 24, 2020, 5:29am UTC](https://community.openpbs.org/t/email-notification-message-body-contents/2077/4 "2020-09-24T05:29:02Z")

</div>

> [@adarsh](#):
>
> can use the pure epilogue script

I’ve found the documentation for the epilogue script (9.3.7.3.i on AG-425/pg609 of PBS big book 19.2.3) but I don’t have an epilogue script in `$PBS_HOME/mom_priv/`

I’ve found such a script in our old xcat deployment code in `torque/scripts/epilogue`

Would they be the same? Is there meant to be a default epilogue script at `$PBS_HOME/mom_priv/epilogue`?

My actual question is more about how to change the “job started” email template - I presume I could make an `$PBS_HOME/mom_priv/prologue`?

---

<div class="post-metadata">

**Author:** ![adarsh](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@adarsh](https://community.openpbs.org/u/adarsh)\
**Post date:** [September 24, 2020, 7:41pm UTC](https://community.openpbs.org/t/email-notification-message-body-contents/2077/5 "2020-09-24T19:41:12Z")

</div>

> [@datakid](#):
>
> Would they be the same?

Might be same.  
For PBS Pro, these are the arguments values to the epilogue script  
# $Id: epilogue  
# $1 = job id  
# $2 = user name  
# $3 = group name  
# $4 = job name  
# $5 = session id  
# $6 = requested resource limits  
# $7 = resources used  
# $8 = queue name  
# $9 = account string  
# $10 = exit code from job

> [@datakid](#):
>
> Is there meant to be a default epilogue script at `$PBS_HOME/mom_priv/epilogue` ?

No, it has to be composed by the cluster admin as per their requirements.

> [@datakid](#):
>
> My actual question is more about how to change the “job started” email template - I presume I could make an `$PBS_HOME/mom_priv/prologue` ?

Job started would have many options – jobs approved by runjob hook, jobs that have reached prologue.

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/pbspro/original/1X/da0c7ad94cb50802795b9f812b333f61a2f65261.png) - Image Credits to PBS Professional Administrator Guide 19.X - Hook Basics Chapter 4 - PBS Professional 19.2.3 Hooks Guide HG-17

Hope this helps

---

<div class="post-metadata">

**Author:** ![datakid](https://avatars.discourse-cdn.com/v4/letter/d/db5fbb/32.png) [@datakid](https://community.openpbs.org/u/datakid)\
**Post date:** [September 24, 2020, 11:44pm UTC](https://community.openpbs.org/t/email-notification-message-body-contents/2077/6 "2020-09-24T23:44:48Z")

</div>

I don’t know that you have strictly answered my question (“how to change the “job started” email template”) but I think that’s because what you were trying to say was ‘judging what “job started” means is hard, here is the list of possible definitions’.

If I was to look into the file tree, where would I find the job started email template? [From what I can tell](https://github.com/openpbs/openpbs/search?q=%22Begun+execution%22), [these email messages are hard-coded](https://github.com/openpbs/openpbs/blob/master/src/lib/Liblog/pbs_messages.c) (!) so the answer is definitively there are no templates, I will need to use a hook and make the decision on which hook to use.

---

<div class="post-metadata">

**Author:** ![adarsh](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@adarsh](https://community.openpbs.org/u/adarsh)\
**Post date:** [September 25, 2020, 7:06pm UTC](https://community.openpbs.org/t/email-notification-message-body-contents/2077/7 "2020-09-25T19:06:50Z")

</div>

Sorry for derailing myself !

> [@datakid](#):
>
> how to change the “job started” email template”

No the email template is fixed and standard and cannot be changed.  
However, you can compose your own mail format using the hook events

> [@datakid](#):
>
> so the answer is definitively there are no templates, I will need to use a hook and make the decision on which hook to use.

Your understanding is correct here.

Thank you
