Send 2 e-mail based on drop-down selection | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Send 2 e-mail based on drop-down selection

Hi guys! I have a question regarding sending e-mail when selecting an option in the drop-down list. I have 10 cities as an option in the drop-down list and when I choose a city (eg London) I want the submit button to send e-mail to the London office. Also send the same email to the head office. So 2 e-mails every time you choose a city (selected city and head office). I also want to mention that it needs to be made with javascript, html and css only. I was wondering if I can do it with switch statment in javascript. What do you think? Do you have any other suggestions? All suggestions and tips are appreciated. Thank you.

12th Nov 2020, 4:08 PM
Alvedin
Alvedin - avatar
6 Answers
+ 1
Sabit_iz_Tarcina short answer is yes you can do it with switch case in javascript and node.js
12th Nov 2020, 4:25 PM
BroFar
BroFar - avatar
+ 1
@BroFar I also wonder is it possible with switch to send 2 emails or just one? do you have another tip that can do with javascript maybe?
12th Nov 2020, 4:32 PM
Alvedin
Alvedin - avatar
+ 1
you can designate 2 locations to switch case to. Alternative would be php, both can process as just in time.
12th Nov 2020, 4:36 PM
BroFar
BroFar - avatar
+ 1
Okay thank you for tip, I'll try it :)
12th Nov 2020, 4:37 PM
Alvedin
Alvedin - avatar
0
how about assign an email to each item in drop down, data- attribute might be handy. then add listener that open multiple mailto: link using that data- attributes
12th Nov 2020, 5:06 PM
Rei
Rei - avatar
0
@Rei Hmm, I'm not so good on Javascript. Can you show me with eg how you think?
12th Nov 2020, 5:55 PM
Alvedin
Alvedin - avatar