OTRS - ticket from api, can't send email notification to customer - rest

I'm trying to send email notification to customer after ticket is created with OTRS rest api. I know that it's impossible only with api so I created notification that reacts on TicketCreated event. My problem is email recipent. Notification is working on hardcoded email but I want to send notification to customer from ticket. When I'm selecting "customers" in recipent groups it's not working for tickets from api. But it's working for tickets created in web interface - result is that customer receive 2 emails - one original and one from notification. What I'm doing wrong? How to set customer with api? Below is my request
{
"Ticket":{
"Title":"REST Create Test",
"Type":"Unclassified",
"Queue":"Raw",
"State":"open",
"Priority":"3 normal",
"CustomerUser":"customer.email#gmail.com"
},
"Article":{
"Subject":"some subject ",
"Body":"nice body",
"ContentType":"text/plain; charset=utf8",
"From":"otrs#fancy.company"
}
}

Even if no customer found in backend passed via web service, notificator will try to send mail to first mail sender - "customer.email#gmail.com" in your case.
Keep in mind that NotificationEvent is transactional by default, so it works in TicketObject destructor.
So reasons are:
Destructor is not called (for example inside of scheduler tasks). In this case you must call destructor manually.
More likely that ticket attributes have been changed after calling TicketCreate. So when destructor is performed, one of your notification attributes (Queue, Service, etc.) doesn't match ticket attribute.

I have got same issue. Don't know why. I created ticket successfully via rest API.

Finally I got solution to fix it. Just modify or create new event in "Ticket Notifications". Add event create ticket and set ticket filter is "open", "close" image

Related

Notifications list for Azure API Management using REST API

Anybody know if it's possible to add email addresses to the notification list for Azure API Mangement via a REST API? Specifically, I would like to be able to add to the "Approaching subscription quota limit". I see that there's a way to do this in the UI, but I'm looking for a way to do this via REST call or PowerShell commandlet (if possible).
The docs are still in progress, and stuff might change a bit, but in short:
GET /notifications - get list of all notifications in system
GET /notifications/{nid} get single notification
GET /notifications/{nid}/recipients - get list of recipients for single notification
GET /notifications/{nid}/recipients/emails - get list of email recipients subscribed to notification
GET /notifications/{nid}/recipients/users- get list of user recipients subscribed to notification
GET/HEAD/PUT/DELETE /notifications/{nid}/recipients/emails/{email} - get/manage single email recipient
GET/HEAD/PUT/DELETE /notifications/{nid}/recipients/users/{user} - get/manage single user recipient
I just got a response from Microsoft. It turns out that it's only possible to add email addresses to the notification list by UI at the moment.

Retrieving who created a meeting "on behalf of" in EWS SOAP service

I've been working in a meeting management app using EWS SOAP service (Exchange 2010 SP1), but for meetings created on behalf of a certain user I cannot know who is this user when I try to get the meeting data through EWS SOAP.
In Outlook (2010 specifically) I can see the name of the account who has acting in behalf of another account on a meeting request for accept or rejection (e.g. Some User ; on behalf of; Another User ), then I want to retrieve the same information through EWS.
I tried to retrieve the meeting information using the example of https://msdn.microsoft.com/en-us/library/office/dn439786(v=exchg.80).aspx changing the Element IdOnly by AllProperties
but I cannot see the property that define who acted in behalf of this account
Is there any way to obtain this user's email or name?
I believe that you need to check this on the meeting request, not the appointment. Check the From and Sender, as I recall the Sender would be the delegate, and the From would be the delegator (though I may have them switched :))

How do I trigger a email in Magento when an order is made?

I need solution for the following:
1) Customer places order
2) Store owner recieves email WITHOUT price info (e.g. packing list)
What files do I need to edit (I've read lots of posts and they don't seem to mention the file paths).
Thx
Two possible ways to achieve that:
You can create a model rewrite for the class Mage_Sales_Model_Order and override the function Mage_Sales_Model_Order::sendNewOrderEmail by sending an email to the shop owner using a different template
You can set the configuration entry "Sales Email/Order/Send Order Email Copy To" to nothing (so that the shop owner doesn't get the same email as the customer), and implement an observer catching the event sales_order_place_after. In the observer function you implement sending of an email to the shop owner using a template without the price info.
I know I had a hack for it ... and then I don't have it anymore. I went through everything I could and right now, we're CCing ourselves the customer notification email. As soon as we're done with our site upgrade, I'll have to readd my hack. I'm pretty sure it's in app/core/Mage/Sales/Model/Order.php possibly in public function sendNewOrderEmail()
See this pic:
I remember hard coding in a file after the customer notification was sent, we sent another one to admin but hard coding the template ID for the transactional order notification email to 8. Now, somehow, I'm doing it the "right way" but have no idea how I'm triggering this transactional email to ALSO happen with the customer order notification.
Make your custom module in that module just send a event after "sales_order_save_after".
Catch this event in observer file and put your custum coding on observer.
Read this

which event is trigger,when a mail is sent by magento store?

I want to store all emails information,which is sent by magento store.For this i want to trigger a event,after a email is sent by magento store.there are lot of such action is there like when a email is send to user like forget password,registration,newsletter subscribe,wishlist share etc.
There is one idea in my mind that if there is such event is exist in magento like email_send_after,i can add my custum coding in observer file and get that event is trigger or not.but i don't know is there any event or not?
you might be interested in this but you can always configure the store email section as described here Also check out this blog post - v helpful

rest api design -> email notification

Is it bad practice to do automatic notification (email/sms/etc) as part of an api call? Or should that be separated from the core functionality.
Say I update a project status and want to send notification to all users watching the project.
Can I do that from the update call or should I break it out into some other notification mechanism? Any thoughts? If doing it from the call I guess each relevant method would need an option of skipping sending notifications.
I would add to a response by Rafael Mueller that there is a difference between RESTful interface and implementation mechanics.
As far as RESTful interface is concerned here are my thoughts. Let's say you update a project status with "PUT /project/123/status". Whether email is going to be send or not it's up to a value proposition of your app. May be that's how you want to differentiate yourself from your competitors.
Let's say you support sending of emails but you want to give control to a client on a call-by-call basis. I would go with an optional HTTP Header or an optional attribute of the request body be it JSON or XML or anything else.
Once you allowed variability in emailing project status, I would advice to design a designated end-point to trigger email update on demand. Something like "POST /project/123/status/send-email". This way your client won't shoot itself in a foot: if they forgot to send email during a project status update, or simply changed their mind, they can always call "send-email".
I would rise an event, ProjectUpdated, you can add it to your messaging system (a database could solve, or rabbitmq, msmq...) and the consumer of this event, will send the email.