# Global email setting

**URL:** <https://discourse.openondemand.org/t/global-email-setting/123>\
**Category:** Feature Requests and Roadmap Discussion\
**Tags:** feature-request\
**Created:** [January 10, 2019, 4:21pm UTC](https://discourse.openondemand.org/t/global-email-setting/123 "2019-01-10T16:21:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![maflister](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/maflister/32/139_2.png) [@maflister](https://discourse.openondemand.org/u/maflister)\
**Post date:** [January 10, 2019, 4:21pm UTC](https://discourse.openondemand.org/t/global-email-setting/123/1 "2019-01-10T16:21:18Z")

</div>

Trying to setup email on start/terminate for jobs. Seems that emails are sent by default to user@ondemand.host. I saw a post suggesting the following per app setting in submit.yml.erb:

```auto
script:
  email: <%= ENV["USER"] %>@my.domain

```

Is there a way to set this globally rather than in each app?

---

<div class="post-metadata">

**Author:** ![efranz](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/efranz/32/27_2.png) [@efranz](https://discourse.openondemand.org/u/efranz)\
**Post date:** [January 25, 2019, 9:58pm UTC](https://discourse.openondemand.org/t/global-email-setting/123/2 "2019-01-25T21:58:52Z")

</div>

To verify, the goal is to set the email argument for each user, for each interactive app, in a single place.

What resource manager are you using?

Out of the box we don’t support this, but we have discussed adding support for this type of thing, as we would find it very useful as well. These are some related issues we have currently opened up:

- [https://github.com/OSC/ood\_core/issues/97](https://github.com/OSC/ood_core/issues/97) - want the ability to add default submission arguments in the cluster config for every job submitted through OnDemand
- [https://github.com/OSC/ood-dashboard/issues/383](https://github.com/OSC/ood-dashboard/issues/383) - we want to force the account value users submit in our interactive apps to be upper case

I’ll add a reference to this from the first issue mentioned.

There may be some work around’s that might be sufficient for you. For example, in a custom Rails initializer you could add some code that sets default value, using monkey patching. But this is not necessarily reliable to work between versions of OnDemand.

---

<div class="post-metadata">

**Author:** ![maflister](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/maflister/32/139_2.png) [@maflister](https://discourse.openondemand.org/u/maflister)\
**Post date:** [January 29, 2019, 4:39pm UTC](https://discourse.openondemand.org/t/global-email-setting/123/3 "2019-01-29T16:39:38Z")

</div>

I’d like the ability to set a global email domain that applies to any user when the ‘email\_on\_started’ is indicated in an app. Currently it assigns the OnDemand host as email domain by default. The only issue I can see is if you support federated login with multiple domains.

I am using Torque.

Thanks for the issues links and suggestions.

---

<div class="post-metadata">

**Author:** ![efranz](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/efranz/32/27_2.png) [@efranz](https://discourse.openondemand.org/u/efranz)\
**Post date:** [January 30, 2019, 6:09pm UTC](https://discourse.openondemand.org/t/global-email-setting/123/4 "2019-01-30T18:09:54Z")

</div>

In the cluster config, you can add this section:

```auto
  batch_connect:
    basic:
      header: "#SBATCH --mail-user=$USER@my.domain"
    vnc:
      header: "#SBATCH --mail-user=$USER@my.domain"

```

That would add this line above all the scripts submitted when submitting interactive apps. However, my guess is that Slurm will not interpolate the string “$USER”. If we made the cluster configs render-able via erb when the user’s dashboard process loads it, then this could be an option. I’ll update the issue with this insight.

---

<div class="post-metadata">

**Author:** ![datakid](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/datakid/32/248_2.png) [@datakid](https://discourse.openondemand.org/u/datakid)\
**Post date:** [September 23, 2020, 11:23pm UTC](https://discourse.openondemand.org/t/global-email-setting/123/5 "2020-09-23T23:23:37Z")

</div>

I’m looking for something similar. Is there a way to change the email domain from OnDemand host to the plain [domain.com](http://domain.com)? Since our email addresses follow the simple rule @ the preference would be for the email to be set as soon as a user logs in. We use PBSPro.

---

<div class="post-metadata">

**Author:** ![westburg.2](https://avatars.discourse-cdn.com/v4/letter/w/0ea827/32.png) [@westburg.2](https://discourse.openondemand.org/u/westburg.2)\
**Post date:** [May 26, 2022, 4:11pm UTC](https://discourse.openondemand.org/t/global-email-setting/123/6 "2022-05-26T16:11:36Z")

</div>

Closed on May 26, 2022, 4:11pm UTC


