luc-github / ESP3D

FW for ESP8266/ESP8285/ESP32 used with 3D printer
GNU General Public License v3.0
1.73k stars 465 forks source link

[FEATURE REQUEST]🦄allow to add picture in notification #525

Open luc-github opened 3 years ago

luc-github commented 3 years ago

ability to attach picture or document to notification email telegram line pushover

one usage would be to enclose a camera capture per user feedback TBC

it is definitly not a priority task so no time frame defined

liqijian101 commented 1 year ago

hi luc,do you have time to add this feature now? I tried to add it, but I failed. This is a very useful feature.

liqijian101 commented 1 year ago
//Send message
camera_fb_t * fb = NULL;
size_t _jpg_buf_len = 0;
uint8_t * _jpg_buf = NULL;
fb = esp_camera_fb_get();
_jpg_buf_len = fb->len;
_jpg_buf = fb->buf;
Notificationclient.printf("From:ESP3D<%s>\r\n",_settings.c_str());
Notificationclient.printf("To: <%s>\r\n",_settings.c_str());
Notificationclient.printf("Subject: %s\r\n\r\n",title);
//Notificationclient.println(message);
Notificationclient.println("Content-Type:image/jpg;name=ESP3D.jpg\r\n");
Notificationclient.println("Conten-Transfer-Encoding:base64\r\n\r\n");
Notificationclient.print(base64::encode((const char *)_jpg_buf));
esp_camera_fb_return(fb);
fb = NULL;
_jpg_buf = NULL;
log_esp3d("Send final dot");
//Send Final dot
Notificationclient.print(".\r\n");
luc-github commented 1 year ago

No sorry, it is still in (huge) todo list

liqijian101 commented 1 year ago

HI Luc, I have modified the notification. c file and now I can send images via email. As long as I send the notification, the images will be sent. Can you make this feature more perfect?

luc-github commented 1 year ago

I am sorry I have no bandwidth for this currently, more over I am almost neve r at home, also this feature is not limited to email but all notifications did you managed it ?