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 724961
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T06:16:59+00:00 2026-05-14T06:16:59+00:00

i want to send an email to user after he sign-up with code.for ex

  • 0

i want to send an email to user after he sign-up with code.for ex

http://192.168.1.51:3000/logins/activate/435546dgfd757676657 #link contains in an email

how can i create the above URL in my notifier model.
i know following way

url_for :controller=>'logins', :action=>'activate', :id=>'435546dgfd757676657' , :host=>'http://192.168.1.54:3000'

Which is working properly.
what i want that host should not be hard coded. How can i get host with port in a model.

In controller i can find it using follwing ways

request.host_with_port

Please provide me correct ruby way for doing same.

  • 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-14T06:17:00+00:00Added an answer on May 14, 2026 at 6:17 am

    You can define the host in your environment.rb file.

    config.action_mailer.default_url_options = { :host => 'localhost:3000' }
    

    As your host probably changes depending of your environment (development, test, production), it’s better to put that config line inside the environment file.

    After that, every link in emails will be made with that host. You don’t have to provide it in the view anymore.

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

Sidebar

Related Questions

After user registration, website send activation code to email. something like that. www.domain.com/?activate=<code> I'm
I want to send an Email message after a page is returned to the
I want to send an email with login details to user emailaddress whenever Admin
I don't know PHP. I don't want the user to go to http://www.example.com/feedback-thanks.html after
After user places an order I have to send detailed email message containing order
I want to send email of a user to foursquare and get permission about
I want send a email by Email Class in codeigniter with gmail, but i
I want to send email from a Ruby application. Is there a call in
In my application i want send a email to one account.in one button click
I am new with cron job in php,basically i want to send email to

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.