In order to send a PageMailDefinition email from disjointed code (modified order state transition actions) it appears to require some lookup info for the email acquisition. IoC.Resolve< RouteRequestLookupInfoAccessor >().RouteRequestLookupInfo = new RouteRequestLookupInfo(…)
So far i’ve figured out that you need a Channel, DomainName and a DomainNameLink. Assuming I have a Channel, how are the other values best attained? Is it actually a good approach to assign these values manually?
The route request won’t be set if the code is from integration.
You could get the channel id from the order object and use that with the mail service. Would your mail work differently from the order confirmation mail? (besides content)
It would work the same way as the order confirmation page mail, and I already have the channel from the order object, the main issue is the DomainName and DomainNameLink, which I would assume should always point to localhost.
I made the other thread, and for whatever reason, I cannot send the email without manually setting the RouteRequestLookupInfo, my main issue is that I do not know how I can get the correct DomainNameLink and Domain from the Channel. I can get a domain, but I do not know of a way I can dynamically get the correct one for any channel.
On the channel there’s a DomainNameLinks property with all the connected domains to the channel. The first one in the list is the main domain, while any others are possible alternative domains. So if you look up that one using the domain name service, wouldn’t you get the information you need?