# BUG: Email node doesn't use node name for debug message

**URL:** <https://discourse.nodered.org/t/bug-email-node-doesnt-use-node-name-for-debug-message/57434>\
**Category:** Core Development\
**Created:** [28 January 2022 23:59 UTC](https://discourse.nodered.org/t/bug-email-node-doesnt-use-node-name-for-debug-message/57434 "2022-01-28T23:59:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![daxliniere](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/daxliniere/32/42187_2.png) [@daxliniere](https://discourse.nodered.org/u/daxliniere)\
**Post date:** [28 January 2022 23:59 UTC](https://discourse.nodered.org/t/bug-email-node-doesnt-use-node-name-for-debug-message/57434/1 "2022-01-28T23:59:51Z")

</div>

I just spotted that the node name in the debug messages for the send email node displays the To field instead of the Name field.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/b/eb9a834967984b0365ee52461162ad6e011b2783.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 January 2022 00:18 UTC](https://discourse.nodered.org/t/bug-email-node-doesnt-use-node-name-for-debug-message/57434/2 "2022-01-29T00:18:02Z")

</div>

The Debug displays the label of the node - what it shows in the workspace - which may not be the name.

In this instance, it looks like the email node displays the to field, if set, in preference to the name.

> <https://github.com/node-red/node-red-nodes/blob/5c333db0ddb445442a998452e7c55e89b81e08da/social/email/61-email.html#L89>

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [29 January 2022 00:37 UTC](https://discourse.nodered.org/t/bug-email-node-doesnt-use-node-name-for-debug-message/57434/3 "2022-01-29T00:37:14Z")

</div>

I guess it would make sense for that to be prioritised the other way round, so it uses he name if set, and if not then the to field, and finally just the word "email".

Though looking at the code it's more mixed up than that... so untangling it would potentially break users - not to be undertaken lightly...

---

<div class="post-metadata">

**Author:** ![daxliniere](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/daxliniere/32/42187_2.png) [@daxliniere](https://discourse.nodered.org/u/daxliniere)\
**Post date:** [29 January 2022 00:57 UTC](https://discourse.nodered.org/t/bug-email-node-doesnt-use-node-name-for-debug-message/57434/4 "2022-01-29T00:57:03Z")

</div>

> [@knolleary](#):
>
> The Debug displays the label of the node - what it shows in the workspace - which may not be the name.

Ahh, I see.

> [@dceejay](#):
>
> I guess it would make sense for that to be prioritised the other way round, so it uses he name if set, and if not then the to field, and finally just the word "email".

Yes, agree 100%.

> [@dceejay](#):
>
> Though looking at the code it's more mixed up than that... so untangling it would potentially break users - not to be undertaken lightly...

That's a shame.

No worries, it's not a huge big deal, just something I spotted and thought I should report.

Cheers, guys!  
Dax.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [30 March 2022 00:57 UTC](https://discourse.nodered.org/t/bug-email-node-doesnt-use-node-name-for-debug-message/57434/5 "2022-03-30T00:57:21Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
