# How to send a email with a if statement

**URL:** <https://discourse.nodered.org/t/how-to-send-a-email-with-a-if-statement/67104>\
**Category:** General\
**Created:** [30 August 2022 06:39 UTC](https://discourse.nodered.org/t/how-to-send-a-email-with-a-if-statement/67104 "2022-08-30T06:39:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![DionCosina](https://avatars.discourse-cdn.com/v4/letter/d/da6949/32.png) [@DionCosina](https://discourse.nodered.org/u/DionCosina)\
**Post date:** [30 August 2022 06:39 UTC](https://discourse.nodered.org/t/how-to-send-a-email-with-a-if-statement/67104/1 "2022-08-30T06:39:37Z")

</div>

I extract a weather http api link in node red. I want to make a if statement that says if the temperature is below 20 degree i get a email saying "you can wear shorts today". How do i do that?

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [30 August 2022 06:59 UTC](https://discourse.nodered.org/t/how-to-send-a-email-with-a-if-statement/67104/2 "2022-08-30T06:59:38Z")

</div>

You can make conditional (if's) using the switch node. Set the proprty to the var you wish to compare, then you can set the rules below.

---

<div class="post-metadata">

**Author:** ![Sean-McG](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sean-mcg/32/54677_2.png) [@Sean-McG](https://discourse.nodered.org/u/Sean-McG)\
**Post date:** [31 August 2022 19:18 UTC](https://discourse.nodered.org/t/how-to-send-a-email-with-a-if-statement/67104/3 "2022-08-31T19:18:46Z")

</div>

You only wear shorts when its cold ? 😉

---

<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 October 2022 19:19 UTC](https://discourse.nodered.org/t/how-to-send-a-email-with-a-if-statement/67104/4 "2022-10-30T19:19:20Z")

</div>

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