Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4059850
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T15:15:42+00:00 2026-05-20T15:15:42+00:00

require ‘digest’ class UserMailer < ActionMailer::Base def receive_compliment(compliment) @recipients = #{compliment.receiver.email} @from = SERVICE_EMAIL

  • 0
require 'digest'
class UserMailer < ActionMailer::Base

  def receive_compliment(compliment)
    @recipients  = "#{compliment.receiver.email}"
    @from        = SERVICE_EMAIL
    @subject     = "Nouveau compliment de #{compliment.user.to_str}"
    @sent_on     = Time.now
    @compliment  = compliment    
    @content_type = "text/plain"
    @body[:url] =  user_compliments_url(@compliment.receiver)
    @body[:root_url] = root_url(:host)      
  end

end

Hi, guys.

As you see above. this is the code sending mail.
I use UserMaililer.send_later("deliver_receive_complimen",compliment) to send mail.
and the mail sent, however, when I open the mail, I got something like this:

Bonjour Kamil ,

 vous a envoyé un compliment sur Blanee!

Cliquez ici pour afficher l’expéditeur et ses commentaires sur vous :
http://http://feature.blanee.net/membres/compliments/66

Merci,
L'équipe Blanee
________________
Ce mail est à l'attention de Kamil  B..
Vous voulez contrôler les notifications que vous recevez? Veuillez vous rendre sur : http://http://feature.blanee.net/mon-compte/notifications.
Vous ne vous êtes pas inscrit sur Blanee et vous avez reçu ce mail? Veuillez le signaler en envoyant un email à l'adresse suivante : admin@blanee.net

As you see above . there are two http://, anybody help? I tested . if I send mail directly, then there is only one http://, but when I sent it by delayed_job then it shows two http:///

my ERB template file:

Bonjour <%="#{@compliment.receiver.first_name.to_s.strip},"%>

<%=h(@compliment.user.to_str)%> vous a envoyé un compliment sur Blanee!

Cliquez ici pour afficher l’expéditeur et ses commentaires sur vous :
<%=@url%>

Merci,
L'équipe Blanee
________________
Ce mail est à l'attention de <%=@compliment.receiver.email%>.
Vous voulez contrôler les notifications que vous recevez? Veuillez vous rendre sur : <%=@root_url%>mon-compte/notifications.
Vous ne vous êtes pas inscrit sur Blanee et vous avez reçu ce mail? Veuillez le signaler en envoyant un email à l'adresse suivante : admin@blanee.net

and in fact, I tried wrote the *_url in the template file. but it still bug when sent from delayed_job.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T15:15:48+00:00Added an answer on May 20, 2026 at 3:15 pm

    When using restful URLs with Action Mailer, you should generate the url with a :host parameter inside the mailer. Does the following work for you?

    Cliquez ici pour afficher l’expéditeur et ses commentaires sur vous :
    <%= user_compliments_url(@compliment.receiver, :host => 'feature.blanee.net') %>
    

    Be sure to leave the http:// off the :host.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

require 'rubygems' require 'test/unit' class Thing attr_accessor :foo def set_stuff @foo = 'bar' end
require 'sinatra/base' class Foo < Sinatra::Base get('/foo') { 'foo' } end class Bar <
Example: require 'commandline' class App < CommandLine::Application def initialize end def main raise 'foo'
require 'test_helper' class MyTest < ActionController::IntegrationTest test view posts from login page do visit(/logins/new)
I require a tree / directed acyclic graph implementation something like this: public class
require 'rubygems' require 'active_record' ActiveRecord::Base.establish_connection( :adapter => 'mysql2', :database => 'vft', :user => 'vft',
require_once('phpmailer/class.phpmailer.php'); function smtpmailer($to,$from,$subject,$body) { define('GUSER', 'xxx'); // Gmail username define('GPWD', 'xxx'); // Gmail password
Possible Duplicate: PHP: Require() and Class Hierarchies Is this bad practice? Is there any
Given: require 'rubygems' require 'nokogiri' value = Nokogiri::HTML.parse(<<-HTML_END) <html> <body> <p id='para-1'>A</p> <div class='block'
require 'liquid' require 'extras/liquid_view' if defined? ActionView::Template and ActionView::Template.respond_to? :register_template_handler ActionView::Template else ActionView::Base end.register_template_handler(:liquid,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.