How to add Contact Group to Exchange-2007 Email Account? - email

I use EWS to manage Emails, Contacts, Groups and Calendar of Exchange server accounts.
I want to add Contact Group. I have tried by following code.
ContactGroup myContactGroup = new ContactGroup(service);
// Give the group a name.
myContactGroup.DisplayName = "My family";
// Add some members to the group.
myContactGroup.Members.Add(new GroupMember("sadie#contoso.com"));
myContactGroup.Members.Add(new GroupMember("alfred#contoso.com"));
// Save the group.
myContactGroup.Save();
But this method is for Exchange 2010 and greater version?
Can anybody suggest me how to add/update Contact Group for Exchange-2007?

On 2007 with EWS the only way to do this is to modify the Extended properties relating to the Members there's an old sample in https://social.technet.microsoft.com/Forums/office/en-US/b01cefad-b8a7-431f-82b1-c0a1ce2b1da8/add-members-to-a-public-distribution-list-programmatically-using-ews?forum=exchangesvrdevelopment
Cheers
Glen

Related

How to send multiple confirmation emails after order-process in HYBRIS?

How can I send multiple emails after order-process? In my way when I add products to cart and go to cart , I have option to choose some emails. For example before place order I want to send emails and to test#test.com, test1#test.com and test3#test.com confirmation emails. Hybris OOTB has a process for sending email to customer which you are login in storefront. ( For example lucas#lucas.com ) . So I'm with Lucas in storefront and now when I place order only Lucas#lucas.com recived an email from customerservices#hybris.com. I saw in GenerateEmailAction.java this piece of code
final List<EmailMessageModel> emails = new ArrayList<>();
emails.addAll(businessProcessModel.getEmails());
emails.add(emailMessageModel);
businessProcessModel.setEmails(emails);
getModelService().save(businessProcessModel);
so probably somehow can set multiple emails. One note, when I place order , I already have in orderProcessModel selected emails.
orderProcessModel.getOrder().getEmails()
which is Collection< String>
In OOTB Hybris email functionality does not support attachment, CC, BCC, multiple toAddress, etc. It should be OOTB, I hope it may come in the latest version.
To solve this, you have to define those custom attributes in BusinessProcessModel to stores the values and access them later in DefaultEmailGenerationService service. Also, you have to override the DefaultEmailGenerationService to support multiple toAddress.
For more details, follow hybris-support-multiple-toaddress.

SendGrid Transactional Templates - Address and Unsubscribe Link Broken

I've configured several Transactional Templates to be sent from my SendGrid account via their handy Design Tool, which work great!.
However the Address Line and Unsubscribe links on the template footer aren't activated. In an email they display as placeholders, like so
[Sender_Name]
[Sender_Address], [Sender_City], [Sender_State]
[Sender_Zip]
Unsubscribe << (Not a Hyperlink)
I've followed SendGrid's documentation and configured my account address but am unable to find the solution for this.
Any ideas on this? Thanks for any input or guidance!
To get the unsubscribe to function you will need to create one or more unsubscribe groups. If you look under the Marketing menu you will see the sub menu to create those. Once you create one it will be assigned an ID number. When you are generating your email you will need to pass that ID value in as part of the EmailMessage object. If you are using V3 of the API you will be looking for SetAsm.
As for the Sender fields, for transactional templates they do not work correctly, as they are meant for marketing campaigns. Your two options are:
Remove the Sender fields from that block in the template. Add a new text block above it with static values.
Download the template into HTML and convert the sender objects into substitution variables. You will then be able to set them in your code when you are creating the email.
GitHub Bug
The unsubscribe link will only appear if you create an unsubscribe group and specify it while sending using
asm: {
group_id: <the unsubscribe group ID>
}

TYPO3 tt_products: send a tracking email on status change to admin as well as user

I use tt_products 2.7.18 on TYPO3 6.2.25.
I configured orderEmail_to to the admins email address.
When an order is placed the customer and the admin gets a respective email - as expected.
But when I change the tracking status, only the customer gets an email.
The manual does not tell me how to configure and I'm starting to question the possibility altogether.
Can anyone tell me if and how to configure?
Thanks in advance.
plugin.tt_products {
...
orderEmail_to = admin#emaildomain.com
...
}
It is correct to set the orderEmail_to. You should check in the TypoScript Object Browser (backend module Template) that this setup is applied on your tracking page id, where in this example I have given "admin#emaildomain.com" as the admin's email address.
Only the tracking status numbers between 50 and 59 will send a notification email to the customer.
tt_products 2.7.27 is already available. Maybe your version 2.7.18 is already outdated.

Change the displayname of the sender when sending mail via o365?

Is it possible to control the display name of the sender when sending mails with the office 365 OutlookServicesClient?
I.e., I want to use, say mailer#domain.com as the sender which is configured with the name some name#domain.com in office 365. But for a given mail I want the from name to instead be some other name#domain.com.
I've tried this:
Message draftMessage = new Message
{
Subject = subject,
Body = body,
ToRecipients = toRecip,
CcRecipients = ccRecip,
From = new Recipient()
{
EmailAddress = new EmailAddress() { Address = "mailer#domain.com", Name = "Some other name#domain.com" }
}
};
But the mail is still sent with the preconfigured name of some name#domain.com.
So, is what I want possible?
According to the reference documentation for the Message object, what you want to do is possible. However, logic tells me that shouldn't be possible, and furthermore, the testing I did showed me it wasn't possible (or isn't working). I will follow up on this and update this answer when I get a definitive answer, but at this time, it appears like you can't change the name of the sender (or it's broken).
UPDATE: The From property is writable. I've tested this using pure REST, so I can't speak exactly to what the client library you are using is doing, but I think the request is being transformed to prevent spoofing.
It is possible to control the display name of the sender, but you can only do so with other users in your Office 365 tenant. To do this, sign in to the Office 365 Admin Portal, go to Users, then Active Users, then select the user (User A) that you want to send on behalf of. Click Edit and select Mailbox Permissions. Add the alias or email address of the user (User B) who is running the code (the user authenticated with your app) to the first box under Send email from this mailbox. This will allow you to set the From property of a message sent by User B as User A.
I understand this isn't exactly what you were after, but having the ability to send email as any email address can lead to some bad stuff. Hope this helped!

TFS email notification

When I add a bug (Work Item) in TFS, and assign it to a user, I want an email sent to that user.
Also if an existing bug has the "Assigned To" changed, I want that user to get an email.
Is it possible to send Alerts to users when they're assigned changed bugs in TFS 2008?
In VS 2005 at least, on the Team menu you will find a Project Alerts... item which allows users to specify an email address that will be notified when My work items are changed by others, which covers both the situations you mention. I imagine VS 2008 will have a similar thing.
Unfortunately, TFS doesn't have anything built out of the box for this to be done without recipient intervention. Richard Ev comment can work, but is not really sustainable. Each person needs to create this or you need to do it for them and continue doing it for all new team members.
Instead, you're better off creating an Event Subscriber. Here's a very helpful post http://www.codeproject.com/Articles/110292/Team-Foundation-Server-2010-Event-Handling-with-Su.
You'll want to use the IIdentityManagementService to retrieve the corresponding users' email. An example:
using (var projectCollection = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(collectionUri, new UICredentialsProvider()))
{
var gss = projectCollection.GetService<IGroupSecurityService>();
var ims = projectCollection.GetService<IIdentityManagementService>();
var validUsersId = ims.ReadIdentity(IdentitySearchFactor.AccountName, "Team Foundation Valid Users", MembershipQuery.Expanded, ReadIdentityOptions.IncludeReadFromSource);
var validUsers = gss.ReadIdentities(SearchFactor.Sid, validUsersId.Members.Select(x => x.Identifier).ToArray(), QueryMembership.None);
foreach (var member in validUsers)
{
Console.WriteLine("{0}: {1}", member.AccountName, member.MailAddress);
}
}
In VS 2010, if you have the TFS 2010 Power Tools installed you can go to the Team menu and select Alerts Explorer. That will allow you to create new alerts.
I know your post is for 2008, but it's an old post and hopefully you're on 2010 now.
For TFS 2010 there is an easy solution for you now, via a plugin which can be downloaded from
CodePlex - Team Alert
It's a simple copy-paste solution which can take you 5 minutes to put in place using the configuration extract listed in the post below:
This post will show the exact configuration you need to perform what you want.
Notify AssignedTo user of new work (for a specific TFS project)