Check out example codes for "sendgrid ruby on rails". It will help you in understanding the concepts better.

Code Example 1

ActionMailer::Base.smtp_settings = {
  :user_name => 'your_sendgrid_username',
  :password => 'your_sendgrid_password',
  :domain => 'yourdomain.com',
  :address => 'smtp.sendgrid.net',
  :port => 465,
  :authentication => :plain,
  :enable_starttls_auto => true
}

Learn ReactJs, React Native from akashmittal.com