MadeiraData / sql-clr-ics

Send Calendar Event / Appointment Invitations (iCal formatted file) from within SQL Server using a CLR stored procedure
https://git.madeiradata.com/sql-clr-ics/
MIT License
9 stars 1 forks source link

HTML and attachments interoperability #16

Open EitanBlumin opened 4 years ago

EitanBlumin commented 4 years ago

Originally posted by @vhu408 in https://github.com/EitanBlumin/sql-clr-ics/issues/10#issuecomment-614213764

Hi Eitan,

Thanks for your work. Wonder if you can comment on the below and if there's something I'm doing wrong.

1.) I 've found that if I use an HTML body email e.g..

declare @html nvarchar(max)='<html> ..<table>...</table> </html>'
exec sp_send_calendar_event
...
@body=@html
...
GO

The result is an email msg not an event with an attached .ics file for the event (shows in the email as "not supported calendar message.ics") when the HTML is more "complex".. perhaps something to do with formatting(.. don't know.)

2.) I've found that if I use an HTML body that makes use of a CID image (and thus the image is attached..) E.g..

declare @html nvarchar(max)='<html> ..... </html>'
exec sp_send_calendar_event
...
@body=@html,
@file_attachments = 'd:\dir1\picture.png'
...
GO

The result is merely an email msg, even the .ics attachment is missing.

It seems like an event is not created when the HTML is more "complex" or an attachment of any kind if included. And even with the emails (not events), the .ics file is sometime present and sometimes depending on if an attachment is included.

EitanBlumin commented 4 years ago

Thanks, @vhu408 .

I had similar issues myself, getting "not supported calendar message.ics" when trying anything slightly complex. In fact, I've been getting this even when trying something basic as canceling an event (see issue #11 ).

Unfortunately, I do not know how to resolve such issues at this time, because my understanding of ICS formatting is still quite limited.

I would venture a guess that perhaps you should try removing the <HTML> and <body> tags from the body parameter (i.e. treat it as the actual body of the message). But, other than that, I'm at a loss myself.

I attached the help wanted label to this issue.