ankane / mailkick

Email subscriptions for Rails

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Path to manage subscriptions

ACPK opened this issue · comments

What is the path for a user to manage their subscription?

I tried using mailkick_unsubscribe_url but get the error:

undefined method `mailkick_unsubscribe_url'

I also tried "subscribe_subscription_path" which is mentioned when I run rake routes.

commented

You need to include Mailkick::UrlHelper in the class you are genering this URL.

 mailkick_unsubscribe_url(list: 'marketing', email: 'email@gmail.com', user: User.first)
commented

I'm having the same problem and the solution above (adding "include Mailkick::UrlHelper") doesn't work.
"mailkick_unsubscribe_url" always returns undefined method error. Here are my routes:

mailkick_path /mailkick
Mailkick::Engine

Routes for Mailkick::Engine
unsubscribe_subscription_path GET /subscriptions/:id/unsubscribe(.:format)
mailkick/subscriptions#unsubscribe

subscribe_subscription_path GET /subscriptions/:id/subscribe(.:format)
mailkick/subscriptions#subscribe

subscription_path GET /subscriptions/:id(.:format)
mailkick/subscriptions#show

None of these routes work either. I followed the gem installation instructions exactly (twice). Refreshed servers and spent the whole day trying to make this work. I even tried mounting the engine manually in my routes to no avail. The back-end (console) works. I can subscribe/unsubscribe/search Mailkick::OptOut model. Please help.