Hey Kashy,
I have solved this issue.Please follow the below steps for automatically newsletter:
- Install whenever gem and after that run command bundle install.
- It automatically generate a file config/schedule.rb.
- In this file you need to add:
every :hour do
runner “CommunityMailer.deliver_community_updates”
end
you can change time, accordingly to you.
Please follow the below link:
https://github.com/javan/whenever
→ run whenever -w for write the crontab file .
→ You can list installed cron jobs using crontab -l.
For Broken Image:
Change in below file:
app/views/community_mailer/_community_update_listing.html.haml
-
You need to change line number 10 and 24 accordingly:
= link_to((image_tag “https://#{@url_params[:host]}#{listing.author.image.url(:thumb)}”, :width => 50, :height => 50, :style => “display:block;margin-right:20px;margin-bottom:10px;margin-top:0;border:0”), person_url(listing.author, @url_params))
= link_to(image_tag(“https://#{@url_params[:host]}#{listing.listing_images.first.image.url(:email)}”, :class => “listing_main_image”, :alt => listing.title, :height => “100”, :width => “150”, :style => “display:block;margin-left:30px;margin-bottom:20px;margin-top:4px;border:0”, :align => “right”), listing_url(@url_params.merge({:id => listing.id})))
Please let me know if you get any problem in this flow.
Thanks