Configure SMTP with Gem Figaro



Daftar Isi

Configure SMTP with Gem Figaro

What is a figaro?

Figaro is a gem on ruby ​​on rails that is used to hide values ​​in the environment and make applications more secure.

What is the importance of Figaro?
Of course, this is very important, because there are many cases of publicly uploading passwords to the GitHub repository, for example: commit delete password.
To make our application more secure and different from the above case, it would be better to use this Figaro gem, so that the application.yml file is not automatically uploaded to the repository.

Install Figaro


1. Create a new rails project

2. Then add the figaro gem to the gemfile

 gem 'figaro'

3. Run the command below to install Figaro

$ bundle exec figaro install

4. Open the application folder & enter the code below in the figaro/config/ fileapplication.yml

In this file we can set smtp etc.
I will give an example of setting up SMTP using Figaro.

smtp_domain: gmail.com
smtp_authentication: plain
smtp_username: email anda
smtp_password: password email anda

5. Type the code below in the figaro/environments/ filedevelopment.rb

 config.action_mailer.smtp_settings = {
      :address => ENV["smtp_address"],
      :port => 587,
      :domain => ENV["smtp_domain"],
      :authentication => ENV["smtp_authentication"],
      :enable_starttls_auto => true,
      :user_name => ENV["smtp_username"],
      :password => ENV["smtp_password"]'
}

For more information about Gem Figaro, you can click on the link below:

Good luck and happy coding 🙂

PakarPBN

A Private Blog Network (PBN) is a collection of websites that are controlled by a single individual or organization and used primarily to build backlinks to a “money site” in order to influence its ranking in search engines such as Google. The core idea behind a PBN is based on the importance of backlinks in Google’s ranking algorithm. Since Google views backlinks as signals of authority and trust, some website owners attempt to artificially create these signals through a controlled network of sites.

In a typical PBN setup, the owner acquires expired or aged domains that already have existing authority, backlinks, and history. These domains are rebuilt with new content and hosted separately, often using different IP addresses, hosting providers, themes, and ownership details to make them appear unrelated. Within the content published on these sites, links are strategically placed that point to the main website the owner wants to rank higher. By doing this, the owner attempts to pass link equity (also known as “link juice”) from the PBN sites to the target website.

The purpose of a PBN is to give the impression that the target website is naturally earning links from multiple independent sources. If done effectively, this can temporarily improve keyword rankings, increase organic visibility, and drive more traffic from search results.

Jasa Backlink

Download Anime Batch