DEV Community

Discussion on: Headless Magento - Using Frontend URLs in Emails

Collapse
 
rain2o profile image
Joel Rainwater

So, you're saying I can set the BASE_URL of each store in the Magento config to a different URL than where Magento is at, and that will solve this problem? If so, that's so much easier! I'll have to try that out.

Of course that still doesn't solve the problem if you have to map the routes to a different pattern than what Magento generates, but that should only be some situations.

Collapse
 
lukecollymore profile image
Luke Collymore

Yes set a 'stores' scope and the store-view scope_id config values and that should fix the basic issue.

Your solution would be a great start to implementing custom routing when getting more complicated.

Thread Thread
 
rain2o profile image
Joel Rainwater

Wow, that’s so much easier. I’ll have to test that out this week. Thanks for the tip!

Thread Thread
 
rain2o profile image
Joel Rainwater

@lukecollymore I just did some brief testing, and it does seem to work for the most part, though it is limited.
I'm a little curious how you have it working with Vue Storefront? The default routes that come with VSF default theme as well as Capybara don't directly align with what Magento generates for URLs with this approach. Did you implement your own VSF routes that matches all of the Magento generated ones?

If you have any media in emails templates, the media path would need to use the Vue Storefront /img/ processor, unless you have added a proxy to directly access media from Magento instead of using the img processor. I tried setting the base_media_url to something like {{secure_base_url}}/img/1200/1200/resize just to see if that would work and it didn't seem to use that value at all. Maybe I'm missing something there.