Outlook C# - 特定收件人的不同邮件正文 [英] Outlook C# - different message bodies for specific recipients

查看:99
本文介绍了Outlook C# - 特定收件人的不同邮件正文的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一些关于最佳方式的建议(好吧,如果有任何方法),以适应以下场景的应用逻辑。


I有一个添加,将表单区域附加到约会项目。在这种形式中,是关于会议的一些数据 - 他们需要的额外的东西,例如设备等。这些控件是从数据库中填充的。


保存项目后,表单数据将作为项目/用户属性保留在实际消息中。


我希望我可以在保存时提取这些属性,并以自定义邮件正文的形式将它们发送给其他收件人。


我尝试使用

 AppointmentItem.Copy()  

但是,虽然这对于向正确的收件人发送不同的邮件正文有效,它还为每个日历中的每个收件人创建了重复的日历条目。因此,2个收件人为每个用户产生了3个日历条目(此时,
我的第一个问题是 - 是否有办法以某种方式将这些条目组合在一起?或链接它们?)


接下来,我尝试过滤表单数据,只显示与它们相关的控件。当用户有权访问组织者的日历时,这种方法有效,而其他收件人则不然。所以这个理论接下来就会出现......


最后一种方法是不将约会发送给其他收件人,而是创建新项目并将其作为普通电子邮件发送包含数据。最大的缺点是他们不会收到约会的更新,例如时间
更改和取消,这很重要。他们仍然可以被邀请到原始约会接收更新,然后让他们手动将数据电子邮件链接到日历约会。


有没有办法可以链接它们?我可以将一个简单的电子邮件与给定的约会联系起来吗?


或者,我正在尝试用它来制作当前的形式吗?

解决方案

您好,


>以后会有办法以某种方式将这些组合起来吗?或链接他们?)


不。在为其安装加载项之前,您无法控制远程收件人。如果他们安装了插件,那么您可以检测这些条目并创建一个条目。


>有没有办法可以链接它们?我可以将普通电子邮件与给定的约会联系起来吗?


不。 Outlook对象模型不提供任何内容。在本地,您可以使用UserProperties集合(或相反的)将约会的条目ID保存到邮件项目。


您也可以考虑创建
TaskItem
而不是创建多个约会项目。  


I'm looking for some advice on the best way (well, if there is any way at all) to accommodate the application logic of the following scenario.

I have an add in which attaches a form region to an Appointment Item. In this form, is some data about the meeting - extra stuff they need, for example equipment and the like. These controls are populated from a database.

Upon saving the item, the form data is persisted as Item/User properties on the actual message.

I was hoping I could extract these properties at the point of saving, and send them to additional recipients in the form of a custom message body.

I tried to do this by using

AppointmentItem.Copy() 

but although that worked in terms of sending different message bodies to the correct recipients, it also created duplicate calendar entries for each recipient in each calendar. So 2 recipients resulted in 3 calendar entries for each user (at this point, my first question is - would there be a way to somehow group these afterwards? or link them?)

So next, I tried to filter the form data to only display controls relevant to them. This works when the user has access to the organisers' calendar, which is not the case for additional recipients. So that theory was next to go out the window ...

The last resort would be to not send the appointment to the additional recipients, but instead create new items and send those as plain emails with data in them. The big drawback to this is that they won't receive updates to the appointment, such as time changes and cancellations which is important. They could still be invited to the original appointment to receive the updates but that then leaves them to manually link the data email to the calendar appointment.

Is there a way I can link them? Could I 'associate' a plain email with a given appointment?

Or, is what I am trying to do in it's current form not possible?

解决方案

Hello,

> would there be a way to somehow group these afterwards? or link them?)

Nope. You can't control remote recipients until the add-in is installed for them. If they install the plug-in then you can detect such entries and create a single entry.

> Is there a way I can link them? Could I 'associate' a plain email with a given appointment?

Nope. The Outlook object model doesn't provide anything for that. Locally you can save the entry ID of your appointment to the mail item using the UserProperties collection (or the opposite).

You may also consider creating a TaskItem for each recipient instead of creating multiple appointment items.  


这篇关于Outlook C# - 特定收件人的不同邮件正文的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆