# Set the gmail address from the dashboard

**URL:** <https://discourse.nodered.org/t/set-the-gmail-address-from-the-dashboard/9568>\
**Category:** Dashboard\
**Created:** [29 March 2019 09:50 UTC](https://discourse.nodered.org/t/set-the-gmail-address-from-the-dashboard/9568 "2019-03-29T09:50:50Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![JokinSegu](https://avatars.discourse-cdn.com/v4/letter/j/ed655f/32.png) [@JokinSegu](https://discourse.nodered.org/u/JokinSegu)\
**Post date:** [29 March 2019 09:50 UTC](https://discourse.nodered.org/t/set-the-gmail-address-from-the-dashboard/9568/1 "2019-03-29T09:50:50Z")

</div>

Is it possible to change the gmail addredd from the dashboard with an text input and to send the input to that gmail that we write??

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [29 March 2019 09:58 UTC](https://discourse.nodered.org/t/set-the-gmail-address-from-the-dashboard/9568/2 "2019-03-29T09:58:18Z")

</div>

Yes, the readme for the Email node contains the details of how to set the to email address within the message object.

---

<div class="post-metadata">

**Author:** ![JokinSegu](https://avatars.discourse-cdn.com/v4/letter/j/ed655f/32.png) [@JokinSegu](https://discourse.nodered.org/u/JokinSegu)\
**Post date:** [29 March 2019 10:15 UTC](https://discourse.nodered.org/t/set-the-gmail-address-from-the-dashboard/9568/3 "2019-03-29T10:15:09Z")

</div>

![email%20input](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/5/5c32fe52b9c90cfafba7b989e0a63246738309d5.png) ![e-mail%20node](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/2/298e456101136df21a4e3fa3f27b143c224ff9c7.png)

 ![text%20imput](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/0/0c5a1a39961ac8dc055ae43beaacee1e4af0206c.png)  
I have this way and I read the readme but I don´t get it, can you tell me what do I need to write

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [29 March 2019 10:24 UTC](https://discourse.nodered.org/t/set-the-gmail-address-from-the-dashboard/9568/4 "2019-03-29T10:24:17Z")

</div>

The node help says this:

> The default message recipient can be configured in the node, if it is left blank it should be set using the `msg.to` property of the incoming message.

That does not mean you type `msg.to` into edit dialog for the node. It says to leave that field blank, and it will then use whatever value you provide in the `msg.to` property of the messages it receives.

---

<div class="post-metadata">

**Author:** ![JokinSegu](https://avatars.discourse-cdn.com/v4/letter/j/ed655f/32.png) [@JokinSegu](https://discourse.nodered.org/u/JokinSegu)\
**Post date:** [29 March 2019 10:26 UTC](https://discourse.nodered.org/t/set-the-gmail-address-from-the-dashboard/9568/5 "2019-03-29T10:26:40Z")

</div>

so if I just take out the msg.to from the email node is it enaugh?

---

<div class="post-metadata">

**Author:** ![JokinSegu](https://avatars.discourse-cdn.com/v4/letter/j/ed655f/32.png) [@JokinSegu](https://discourse.nodered.org/u/JokinSegu)\
**Post date:** [29 March 2019 10:36 UTC](https://discourse.nodered.org/t/set-the-gmail-address-from-the-dashboard/9568/6 "2019-03-29T10:36:41Z")

</div>

which node do I need to use between both? To send into a msg.to

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [29 March 2019 10:44 UTC](https://discourse.nodered.org/t/set-the-gmail-address-from-the-dashboard/9568/7 "2019-03-29T10:44:14Z")

</div>

Take a look at the "Move a message property" flow in the cookbook [https://cookbook.nodered.org](https://cookbook.nodered.org).

I also notice that you have two wires going into the Email node.  
Each normal node reacts when it receives a message. They don't know to wait until they get additional information in a different message. So you will also need to look at JOINing the two messages together (again the cookbook contains an example)

---

<div class="post-metadata">

**Author:** ![JokinSegu](https://avatars.discourse-cdn.com/v4/letter/j/ed655f/32.png) [@JokinSegu](https://discourse.nodered.org/u/JokinSegu)\
**Post date:** [29 March 2019 11:11 UTC](https://discourse.nodered.org/t/set-the-gmail-address-from-the-dashboard/9568/8 "2019-03-29T11:11:01Z")

</div>

Sory I don´t get it...

 ![email%20alert](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/c/ce2786138474ffe36c8ae8656fa1930d600ee5c7.png)  
This is the full node. I am sending to telegram and e-mail the static text and the value that I am getting per 10 seconds but I want to change the email adress from the dashboard and it doesn´t work. Do you have any example of something similar because I don´t ge it with the documents of node-red I am new at Node-red and I need help please,

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [29 March 2019 11:23 UTC](https://discourse.nodered.org/t/set-the-gmail-address-from-the-dashboard/9568/9 "2019-03-29T11:23:15Z")

</div>

Please tell me you aren't trying to send an Email every 10 seconds?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [29 March 2019 11:25 UTC](https://discourse.nodered.org/t/set-the-gmail-address-from-the-dashboard/9568/10 "2019-03-29T11:25:21Z")

</div>

Hi @JokinSegu

no problem - it can sometimes take a couple goes to 'get' the node-red way of creating flows.

You have your top flow generating the message to send every 10 seconds. By the time that message reaches the email node it needs to have `msg.to` set to something.

You then have the flow from the `email address` dashboard node that is triggered when the user provides an email address.

In this case, the Join node isn't the right way to join those two together. Here is what I would do...

After the `[valor contador]` function node, add a `Change` node configured to set `msg.to` to the value of `flow.email`.  
After the `email address` dashboard node have a `Change` node configured to set `flow.email` to the value of `msg.payload` - and don't wire the output of that node to anything else.

So whenever the user provides a new email address, it will update the value stored in flow context. Then, when a new message comes from the top flow, it will pickup that latest email value from flow context.

Some more observations to consider:

- sending an email every 10 seconds sounds a bit excessive... email isn't normally used for realtime events!
- consider if you need to try to validate the email address provided - you could add a Function node between the `email address` and `change` nodes in order to check the value is sensible.
- an email every 10 seconds?

---

<div class="post-metadata">

**Author:** ![JokinSegu](https://avatars.discourse-cdn.com/v4/letter/j/ed655f/32.png) [@JokinSegu](https://discourse.nodered.org/u/JokinSegu)\
**Post date:** [29 March 2019 11:28 UTC](https://discourse.nodered.org/t/set-the-gmail-address-from-the-dashboard/9568/11 "2019-03-29T11:28:42Z")

</div>

no is just to check if it works or not after put it working I will send a message per day to see how many pieces have we done

---

<div class="post-metadata">

**Author:** ![JokinSegu](https://avatars.discourse-cdn.com/v4/letter/j/ed655f/32.png) [@JokinSegu](https://discourse.nodered.org/u/JokinSegu)\
**Post date:** [29 March 2019 11:41 UTC](https://discourse.nodered.org/t/set-the-gmail-address-from-the-dashboard/9568/12 "2019-03-29T11:41:09Z")

</div>

Okey thank you for your help I have done this changes I don´t know if it is right as you tell me.  
 ![change1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/1/19dbf3d0aa1d52e0d45ab1f71dbb19ba568f3f9b.png) ![change2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/2/219a9c7a4aedf48d0faeb22821c63f6b3a6d65df.png)

 ![email%20alert](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/1/1a295ecbc73199ac0106a8f80af2fa63f0b9551c.png) ![function](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/3/3f863e83c9c9457aa57a1e64bf3569195802c281.png)

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [29 March 2019 11:46 UTC](https://discourse.nodered.org/t/set-the-gmail-address-from-the-dashboard/9568/13 "2019-03-29T11:46:20Z")

</div>

So your dashboard sets a context variable called flow.email

Your move screenimage should say move flow.email to msg.to as it moves that context variable to msg.to which is where the email nodes wants the address

---

<div class="post-metadata">

**Author:** ![JokinSegu](https://avatars.discourse-cdn.com/v4/letter/j/ed655f/32.png) [@JokinSegu](https://discourse.nodered.org/u/JokinSegu)\
**Post date:** [29 March 2019 11:52 UTC](https://discourse.nodered.org/t/set-the-gmail-address-from-the-dashboard/9568/14 "2019-03-29T11:52:11Z")

</div>

![move](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/d/d49383ee124956803c3a9fd7866726f79dee829f.png)  
this way?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [29 March 2019 11:53 UTC](https://discourse.nodered.org/t/set-the-gmail-address-from-the-dashboard/9568/15 "2019-03-29T11:53:01Z")

</div>

I would recommend using `set` rather than `move` - because you want to leave the value in flow context. And if you use `set`, then the first input is the target value and the second input is where it gets the value from.

---

<div class="post-metadata">

**Author:** ![JokinSegu](https://avatars.discourse-cdn.com/v4/letter/j/ed655f/32.png) [@JokinSegu](https://discourse.nodered.org/u/JokinSegu)\
**Post date:** [29 March 2019 12:15 UTC](https://discourse.nodered.org/t/set-the-gmail-address-from-the-dashboard/9568/16 "2019-03-29T12:15:54Z")

</div>

I am receiving in the telegram without problem but don´t get any email... I send you everything step by step.

 ![gmail%20wrong](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/3/344e1264d1f46c5a8a99bab6b22fb2a4ff4d26ac.png)  
 ![delay](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/9/9c84b3800ac71e62ac22e88a7ccc145f3720e2fb.png)  
 ![function](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/1/15436c74da40e6b0cad323a4098ec820e7af93ed.png)  
 ![email](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/c/ca7607fb9e8157701de7f336ec651266c84d5f1d.png)  
 ![email%20node](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/a/a344339c009cf454acfee1486c34b799e4ad5499.png)  
 ![email%20input](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/c/c191f327309125256a56e2de40308cd2a7ec818e.png)  
 ![to](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/6/6745a091d593141a4ff10e13345f2aba83138d41.png)

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [29 March 2019 12:26 UTC](https://discourse.nodered.org/t/set-the-gmail-address-from-the-dashboard/9568/17 "2019-03-29T12:26:24Z")

</div>

Which Change node is that last screenshot? If it is the Change node connected to the `email address` node, then it is not properly configured. The message coming out of the `email address` dashboard node will have the value in `msg.payload`. So your Change node should be setting `flow.email` to the value of `msg.payload`.

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [29 March 2019 12:30 UTC](https://discourse.nodered.org/t/set-the-gmail-address-from-the-dashboard/9568/18 "2019-03-29T12:30:33Z")

</div>

You could also put a debug node onto teh change node before the email node, set it to "output complete message object" and check that all the information is there

---

<div class="post-metadata">

**Author:** ![JokinSegu](https://avatars.discourse-cdn.com/v4/letter/j/ed655f/32.png) [@JokinSegu](https://discourse.nodered.org/u/JokinSegu)\
**Post date:** [29 March 2019 12:35 UTC](https://discourse.nodered.org/t/set-the-gmail-address-from-the-dashboard/9568/19 "2019-03-29T12:35:04Z")

</div>

![change](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/1/1a1e0c1d0561b89eeef639c0f5e83a4725b31ff5.png)  
this way?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [29 March 2019 12:35 UTC](https://discourse.nodered.org/t/set-the-gmail-address-from-the-dashboard/9568/20 "2019-03-29T12:35:58Z")

</div>

Yes - and as @ukmoose suggests, add a Debug node set to display the complete message object next to the Email node so you can see what exactly you are passing in.

[Next page](https://discourse.nodered.org/t/set-the-gmail-address-from-the-dashboard/9568.md?page=2)
