How do I breakline in MATLAB emails?
Mostra commenti meno recenti
Hey, just a simple question that I cant find the answer :(
How do I break lines in MATLAB emails??
I tried with <br> and \n.
This is an screenshot of what I'm talking about

And the String is:
alertBody = "El sistema de monitoreo no ha obtenido ningun dato del Arduino en los ultimos 10 minutos.<br> Se recomienda verificar el dispositivo para su correcto funcionamiento.<br><br>\n\n\n1. Verifique que el Arduino esté con corriente<br>2. Verifique que la conexión Ethernet esté correcta y las luces esten encendidas.<br>3. Si ninguna de estas opciones solucionó el problema, presione el botón rojo ubicado en el Arduino<br>Canal de Información: https://thingspeak.com/channels/970650";
I appreciate any help, thanks and have a nice day!
Risposte (3)
Image Analyst
il 6 Feb 2020
0 voti
Try using sprintf() with single quotes:
alertBody = sprintf('El sistema de monitoreo no ha obtenido ningun dato del Arduino en los ultimos 10 minutos.<br> Se recomienda verificar el dispositivo para su correcto funcionamiento.<br><br>\n\n\n1. Verifique que el Arduino esté con corriente<br>2. Verifique que la conexión Ethernet esté correcta y las luces esten encendidas.<br>3. Si ninguna de estas opciones solucionó el problema, presione el botón rojo ubicado en el Arduino<br>Canal de Información: https://thingspeak.com/channels/970650');
I don't think the <br> would be needed if the \n work.
1 Commento
Benjamin Cortez
il 7 Feb 2020
Vinod
il 7 Feb 2020
0 voti
Try
alertBody = sprintf('El sistema de monitoreo no ha obtenido ningun dato del Arduino en los ultimos 10 minutos.\r\n Se recomienda verificar el dispositivo para su correcto funcionamiento. \r\n 1. Verifique que el Arduino esté con corriente\r\n 2. Verifique que la conexión Ethernet esté correcta y las luces esten encendidas.\r\n 3. Si ninguna de estas opciones solucionó el problema, presione el botón rojo ubicado en el Arduino\r\n Canal de Información: https://thingspeak.com/channels/970650');
4 Commenti
Benjamin Cortez
il 7 Feb 2020
Image Analyst
il 7 Feb 2020
I don't see any \n or <br> in there, so what exactly didn't work? Are there other characters in there you don't want? Or some formatting is not what you desire? Saying "It doesn't work" is virtually useless. What I hear is "It did not work but I don't want to bother to tell you why it didn't work or ask any follow-up question, so I'm just not going to worry about it anymore and will use it as-is."
Benjamin Cortez
il 7 Feb 2020
Modificato: Benjamin Cortez
il 7 Feb 2020
Image Analyst
il 8 Feb 2020
So are we done here? Can you get the layout you want using \n in the right places?
Alain Kuchta
il 10 Feb 2020
Modificato: Alain Kuchta
il 14 Ago 2020
0 voti
Update: As of April 2020, the ThingSpeak Alerts API now supports inclusion of tabs, spaces, and newlines in the alert body text.
---------------------------
Old Answer:
ThingSpeak Alerts do not currently support formatting characters like newlines and tabs. The characters are not removed, but do not display as expected in the email. I have created an enhancement request to add this capability.
1 Commento
Benjamin Cortez
il 10 Feb 2020
Modificato: Benjamin Cortez
il 10 Feb 2020
Community
Più risposte nel ThingSpeak Community
Categorie
Scopri di più su MATLAB in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

