How do I breakline in MATLAB emails?

1 回表示 (過去 30 日間)
Benjamin Cortez
Benjamin Cortez 2020 年 2 月 6 日
編集済み: Alain Kuchta 2020 年 8 月 14 日
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!

回答 (3 件)

Image Analyst
Image Analyst 2020 年 2 月 6 日
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 件のコメント
Benjamin Cortez
Benjamin Cortez 2020 年 2 月 7 日
Mhh it doesn't worked :(

サインインしてコメントする。


Vinod
Vinod 2020 年 2 月 7 日
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 件のコメント
Benjamin Cortez
Benjamin Cortez 2020 年 2 月 7 日
編集済み: Benjamin Cortez 2020 年 2 月 7 日
You don't see any \n or <br> because the program just ignore it. If I do a display of the alertBody String, shows this in the output:
Which tells me that the problem is not the code.
But the email shows the text without breaklines.
Sorry for the poor explanation, and have a nice day!
Image Analyst
Image Analyst 2020 年 2 月 8 日
So are we done here? Can you get the layout you want using \n in the right places?

サインインしてコメントする。


Alain Kuchta
Alain Kuchta 2020 年 2 月 10 日
編集済み: Alain Kuchta 2020 年 8 月 14 日
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 件のコメント
Benjamin Cortez
Benjamin Cortez 2020 年 2 月 10 日
編集済み: Benjamin Cortez 2020 年 2 月 10 日
Thanks for the answer! Have a nice day.
PD: Another thing, Can you ask for HTML support? Like link images with <img src=""> and stuff like that.

サインインしてコメントする。

コミュニティ

その他の回答  ThingSpeak コミュニティ

カテゴリ

Help Center および File ExchangeArduino Hardware についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by