I am running the latest version of Umbraco (7.5.11) and the latest version of Merchello (2.5.0). I'm trying to get the Order Shipped email to send once I mark the order's shipment status as "Shipped" (see screenshot below).
As of right now, only the Order Confirmation is being emailed and seems to be working correctly, so I know the SMTP server is setup and working correctly.
Do I need to do anything specific or manually to get the Order Shipped email to send? I have it setup as message (same as the order confirmation) in the Notification area of Merchello shown below.
I really appreciate your reply and trying to help get this resolved. I have followed your post from the link you provided above, however, the Order Fulfilled notification is still not sending. Based on your post, I created 4 new files in my root directory: IOrderFulfilledNotifyModel, OrderFulfilledNotifyModel, OrderFulfilledTrigger, and RazorOrderFulfilledNotifyMonitor
When I create the RazorOrderFulfilledNotifyMonitor I'm not sure where you're getting the GUID from in the MonitorFor attribute, so I created a new GUID:
[MonitorFor("19993C19-B4D7-4EBC-B2DE-A1A6EEFAE43F", typeof(OrderFulfilledTrigger), "Order FulFilled (Razor)", true)]
public class RazorOrderFulfilledNotifyMonitor : RazorMonitorBase<IOrderFulfilledNotifyModel>
{
public RazorOrderFulfilledNotifyMonitor(INotificationContext notificationContext) : base(notificationContext)
{
}
}
What am I missing? This has been very frustrating to get this notification working and I'm dead in the water until it is working correctly. Just to be clear, I'm assuming this is supposed to be triggered in the back office once I capture the funds and mark the order as fulfilled and select "shipped" from the dropdown.
I think the only thing you are stumbling on is you are assuming this is an "event" ... which it is not.
The system is based on the IObservable<T> - which allows classes (in this case monitors) to subscribe to another class (the trigger). Then, when the trigger is executed, it notifies all of the classes that have subscribed to it that something has happened.
Ok, so I believe I know what the issue is and it seems to be a bug would be my guess. These are the steps to reproduce:
In the back-office, go to Merchello > Sales > Choose an 'unfulfilled' order.
Click the 'capture funds' button (assuming this is a cash payment), and process the payment so there is a zero balance for this order.
Now that the funds have been captured, click the "Fulfill" button and mark the order as "Shipped" from the dropdown menu.
Following these steps results in the Order Shipped notification not sending any email. However, if I then navigate to the "Shipments" tab and choose "Edit Shipment" under the Actions dropdown, make sure the "Shipment Status" is still set to Shipped (which it already will be by following the steps above) and click "Save Shipment" THEN the Order Shipped email gets sent!
Is there no way to have this Order Shipped notification happen when you first choose "Shipped" when you're marking the order as fulfilled?
I ran into this issue when our client said they wanted to have that automated email send when they mark an order shipped; so they didn't have to manually send out an email every time they update it.
I have stalled for a bit on it but now I really need to get this working. Did you ever figure this out completely, or did you have to do the work around and actually go into shipments afterwards and hit save again?
Either way; I'd love to know what you even did and the code/files you needed to create in order to even get to that final step you described. Could you possibly post your solution or I can reach out to you via email, twitter, etc. and talk further?
I would greatly appreciate any knowledge you might have towards this issue because it has been causing great frustration and taking a lot longer than something so simple should.
I'm sorry to hear you're experiencing the same issue I was! I can definitely empathize with how aggravating this has been to get something to work that you'd think should work out of the box. I didn't have time to get this working properly unfortunately, but the workaround of having to resave the order like I described in my previous post is what I do at this point until I have some more time to fix it so it will send the email when you originally mark the order as shipped.
You might be missing something in your UmbracoEventHandler.cs located in your AppCode folder. If you don't have this file then just created it in your AppCode folder and copy and paste this code:
Once you have this file in your App_Code directory then it will fire off the order shipped email assuming you have the email configured through your back office. Let me know if this works for you or if you're still stuck and I'll do what I can to help you get this resolved.
Thank you for your quick response. I have been plugging away at this and trying to create all the necessary .cs files and I had the UmbracoEventHandler.cs file already but just took the one you just posted.
I haven't been able to test this because my issue is that there are soooo many references in these files that are missing assembly references etc.
Things like INotifyModel, referencing Merchello.Core things, IOrder, [MonitorFor, INotificationContext etc. These are all missing assembly references etc. What do I need to reference or include in my project to grab these from Merchello's core? Once I have all those references worked out then I should be able to go ahead and test it.
Thank you so much; your response's are greatly appreciated!
- Chaz
This is what I have at the top of the UmbracoEventHandler.cs file:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Umbraco.Core;
using Merchello.Core.Events;
using Merchello.Core.Models;
using Merchello.Core.Services;
using Umbraco.Core.Logging;
using Merchello.Core;
By adding these does it fix your missing references error? Also, you're talking about errors specifically in this file, is that correct?
Yep same exact version. 7.5.11 and Merchello 2.5.0.
For those 4 files that you created, along with the UmbracoEventHandler.cs file, what do you have as the namespaces and "using" references? That's the one thing I have not seen on any of these files.
Also, I added the "using" references you had posted above for the UmbracoEventHandler.cs file and both "Merchello.Core.Events" and "Merchello.Core.Services" are both saying they don't exist in the namespace.
So I am assuming having the correct namespaces for all of these files would help resolve this. Could you let me know the namespaces you have for this file plus the 4 you created?
Ok, so we're on the same versions of both Umbraco and Merchello, so that's good. Honestly, I got rid of all of the files I created except for the UmbracoEventHandler.cs and it works just great (still having to re-save the order for it to fire the order shipped notification though).
I would try and remove the other files, the IOrderFulfilledNotifyModel.cs, OrderFulfilledNotifyModel.cs, OrderFulfilledTrigger.cs, and RazorOrderFulfilledNotifyMonitor.cs. Then all you should have is just the UmbracoEventHandler.cs file to deal with.
Next, just make sure in your Umbraco back office that you have configured your Order Shipped email.
and the details view:
Also the "using" statements go above the namespace declaration, in your screenshot you have them underneath
namespace Merchello.FastTrack.Ui
{
....
}
It should be:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Umbraco.Core;
using Merchello.Core.Events;
using Merchello.Core.Models;
using Merchello.Core.Services;
using Umbraco.Core.Logging;
using Merchello.Core;
namespace Merchello.FastTrack.Ui
{
....
}
Alright, I have deleted those other 4 files and am just trying to get UmbracoEventHandler.cs to work correctly.
I have it structured just like you have above but as you can see in the screenshots I took below; I am getting quite a bit of errors that are saying the type or namespaces do not exist in the namespace Merchello.Core (Guessing I am missing assembly references).
If I can just get these figured out then I should be good. I am wondering if it's .dll file I am missing or what? Sorry to keep this going; just at a loss right now.
Can you show me what your solution looks like. The UmbracoEventHandler.cs should be located in the App_Code directory.
I don't think you're missing a reference, I think the namespace you're using may be messing you up (Merchello.FastTrack.Ui). Below is what my solution looks like:
My namespace for my UmbracoEventHanlder.cs file is:
namespace YourAppName.App_Code
{
....
}
where "YourAppName" is replaced by whatever you're calling your application.
Still having issues. Changed the location of it and also changed the namespace to be referenced from my project name etc.
I can't even call Merchello in using or in the code, says that namespace or type could not be found... I must be missing some kind of reference or DLL right?
Well this is interesting man. Has this Umbraco solution ever worked for you or have you always had reference issues like this? When I started this Umbraco site I've been working on I started with a blank solution and them used NuGet to install Umbraco. Once it was installed I rebuilt the solution. What process did you use to get Umbraco installed?
After some tinkering and figuring out some stuff; I deleted the file and re-added it and then cleaned and rebuilt and the references were all working now! Thank you so much! I actually just did the steps you listed above with having to go into the shipment field and hitting save after adding it in and it worked!
Thank you so much for your time; I appreciate your time greatly and you have helped me a bunch!
Nice! I'm glad you got it working! I'm still a little confused as to why there is even a manual process for this. It seems pretty standard that you'd want to send some emails depending on certain criteria surrounding an order, such as:
Order Received
Order Shipped
Order Canceled
Order Refunded
Back Ordered
Etc...
I hope they fix this on a very near future release. Best of luck wrapping up your development efforts!
Yeah; I am not sure as to why those wouldn't be baked in if the order confirmation one was baked in. Seems like an easy update to add the other hooks; hopefully comes soon! I have overcome many obstacles with doing custom things with Merchello but have come out a more versed developer afterwards, hah!
Order Shipped Email Notification Not Sending
I am running the latest version of Umbraco (7.5.11) and the latest version of Merchello (2.5.0). I'm trying to get the Order Shipped email to send once I mark the order's shipment status as "Shipped" (see screenshot below).
As of right now, only the Order Confirmation is being emailed and seems to be working correctly, so I know the SMTP server is setup and working correctly.
Do I need to do anything specific or manually to get the Order Shipped email to send? I have it setup as message (same as the order confirmation) in the Notification area of Merchello shown below.
Hey Cory,
You need to add an event handler to trigger that notification:
Take a look at https://our.umbraco.org/projects/collaboration/merchello/merchello/84478-orderconfirmation-general-trigger#comment-84478 ...
Rusty,
I really appreciate your reply and trying to help get this resolved. I have followed your post from the link you provided above, however, the Order Fulfilled notification is still not sending. Based on your post, I created 4 new files in my root directory:
IOrderFulfilledNotifyModel
,OrderFulfilledNotifyModel
,OrderFulfilledTrigger
, andRazorOrderFulfilledNotifyMonitor
When I create the
RazorOrderFulfilledNotifyMonitor
I'm not sure where you're getting the GUID from in theMonitorFor
attribute, so I created a new GUID:What am I missing? This has been very frustrating to get this notification working and I'm dead in the water until it is working correctly. Just to be clear, I'm assuming this is supposed to be triggered in the back office once I capture the funds and mark the order as fulfilled and select "shipped" from the dropdown.
Any help would be greatly appreciated!
Hey Cory - the GUID should be a new Guid.
I think the only thing you are stumbling on is you are assuming this is an "event" ... which it is not.
The system is based on the
IObservable<T>
- which allows classes (in this case monitors) to subscribe to another class (the trigger). Then, when the trigger is executed, it notifies all of the classes that have subscribed to it that something has happened.So you need to execute your trigger with:
This pattern is a bit more versatile than a strict event based system as in some cases you just want to trigger notifications in a method directly.
However, in your case you probably want to trigger the notification in an event handler ... like
OrderService.StatusChanged
?Rusty,
Ok, so I believe I know what the issue is and it seems to be a bug would be my guess. These are the steps to reproduce:
Following these steps results in the Order Shipped notification not sending any email. However, if I then navigate to the "Shipments" tab and choose "Edit Shipment" under the Actions dropdown, make sure the "Shipment Status" is still set to Shipped (which it already will be by following the steps above) and click "Save Shipment" THEN the Order Shipped email gets sent!
Is there no way to have this Order Shipped notification happen when you first choose "Shipped" when you're marking the order as fulfilled?
Hey Cory,
I ran into this issue when our client said they wanted to have that automated email send when they mark an order shipped; so they didn't have to manually send out an email every time they update it.
I have stalled for a bit on it but now I really need to get this working. Did you ever figure this out completely, or did you have to do the work around and actually go into shipments afterwards and hit save again?
Either way; I'd love to know what you even did and the code/files you needed to create in order to even get to that final step you described. Could you possibly post your solution or I can reach out to you via email, twitter, etc. and talk further?
I would greatly appreciate any knowledge you might have towards this issue because it has been causing great frustration and taking a lot longer than something so simple should.
Thanks! - Chaz
Chaz,
I'm sorry to hear you're experiencing the same issue I was! I can definitely empathize with how aggravating this has been to get something to work that you'd think should work out of the box. I didn't have time to get this working properly unfortunately, but the workaround of having to resave the order like I described in my previous post is what I do at this point until I have some more time to fix it so it will send the email when you originally mark the order as shipped.
You might be missing something in your
UmbracoEventHandler.cs
located in your AppCode folder. If you don't have this file then just created it in your AppCode folder and copy and paste this code:Once you have this file in your App_Code directory then it will fire off the order shipped email assuming you have the email configured through your back office. Let me know if this works for you or if you're still stuck and I'll do what I can to help you get this resolved.
Hey Cory,
Thank you for your quick response. I have been plugging away at this and trying to create all the necessary .cs files and I had the UmbracoEventHandler.cs file already but just took the one you just posted.
I haven't been able to test this because my issue is that there are soooo many references in these files that are missing assembly references etc.
Things like INotifyModel, referencing Merchello.Core things, IOrder, [MonitorFor, INotificationContext etc. These are all missing assembly references etc. What do I need to reference or include in my project to grab these from Merchello's core? Once I have all those references worked out then I should be able to go ahead and test it.
Thank you so much; your response's are greatly appreciated! - Chaz
This is what I have at the top of the
UmbracoEventHandler.cs
file:By adding these does it fix your missing references error? Also, you're talking about errors specifically in this file, is that correct?
Here are some screenshots so you can just get an idea of what I am dealing with.
I'm using Umbraco v7.5.11, what version are you on?
Yep same exact version. 7.5.11 and Merchello 2.5.0.
For those 4 files that you created, along with the UmbracoEventHandler.cs file, what do you have as the namespaces and "using" references? That's the one thing I have not seen on any of these files.
Also, I added the "using" references you had posted above for the UmbracoEventHandler.cs file and both "Merchello.Core.Events" and "Merchello.Core.Services" are both saying they don't exist in the namespace.
So I am assuming having the correct namespaces for all of these files would help resolve this. Could you let me know the namespaces you have for this file plus the 4 you created?
Thanks, - Chaz
Ok, so we're on the same versions of both Umbraco and Merchello, so that's good. Honestly, I got rid of all of the files I created except for the
UmbracoEventHandler.cs
and it works just great (still having to re-save the order for it to fire the order shipped notification though).I would try and remove the other files, the
IOrderFulfilledNotifyModel.cs
,OrderFulfilledNotifyModel.cs
,OrderFulfilledTrigger.cs
, andRazorOrderFulfilledNotifyMonitor.cs
. Then all you should have is just theUmbracoEventHandler.cs
file to deal with.Next, just make sure in your Umbraco back office that you have configured your Order Shipped email. and the details view:
Also the "using" statements go above the namespace declaration, in your screenshot you have them underneath
It should be:
Thank you for your responses Cory.
Alright, I have deleted those other 4 files and am just trying to get UmbracoEventHandler.cs to work correctly.
I have it structured just like you have above but as you can see in the screenshots I took below; I am getting quite a bit of errors that are saying the type or namespaces do not exist in the namespace Merchello.Core (Guessing I am missing assembly references).
If I can just get these figured out then I should be good. I am wondering if it's .dll file I am missing or what? Sorry to keep this going; just at a loss right now.
Here are the screenshots.
Can you show me what your solution looks like. The
UmbracoEventHandler.cs
should be located in the App_Code directory.I don't think you're missing a reference, I think the namespace you're using may be messing you up (Merchello.FastTrack.Ui). Below is what my solution looks like:
My namespace for my
UmbracoEventHanlder.cs
file is:where "YourAppName" is replaced by whatever you're calling your application.
Thanks for your help...
Still having issues. Changed the location of it and also changed the namespace to be referenced from my project name etc.
I can't even call Merchello in using or in the code, says that namespace or type could not be found... I must be missing some kind of reference or DLL right?
Well this is interesting man. Has this Umbraco solution ever worked for you or have you always had reference issues like this? When I started this Umbraco site I've been working on I started with a blank solution and them used NuGet to install Umbraco. Once it was installed I rebuilt the solution. What process did you use to get Umbraco installed?
After some tinkering and figuring out some stuff; I deleted the file and re-added it and then cleaned and rebuilt and the references were all working now! Thank you so much! I actually just did the steps you listed above with having to go into the shipment field and hitting save after adding it in and it worked!
Thank you so much for your time; I appreciate your time greatly and you have helped me a bunch!
Thanks, - Chaz
Nice! I'm glad you got it working! I'm still a little confused as to why there is even a manual process for this. It seems pretty standard that you'd want to send some emails depending on certain criteria surrounding an order, such as:
I hope they fix this on a very near future release. Best of luck wrapping up your development efforts!
Yeah; I am not sure as to why those wouldn't be baked in if the order confirmation one was baked in. Seems like an easy update to add the other hooks; hopefully comes soon! I have overcome many obstacles with doing custom things with Merchello but have come out a more versed developer afterwards, hah!
Thanks again! Cheers
would just like to say thank you this worked for me. I finally have order shipped emails going through now
is working on a reply...