%h1 Set up DKIM

%h2 Setting up your DNS
%p You will need to create two text records to your DNS server with the following information:

%table.table
  %tr
    %th Name
    %th Value
  %tr
    %td _domainkey.#{@app.from_domain}
    %td t=y;o=~;
  %tr
    %td cuttlefish._domainkey.#{@app.from_domain}
    %td= @app.dkim_public_key_dns_dnsmadeeasy

%h3 Current value in DNS

- a = Net::DNS::Resolver.start("cuttlefish._domainkey.#{@app.from_domain}", Net::DNS::TXT).answer.first.txt
%p= a

%p
  - if a == @app.dkim_public_key_dns_dnsmadeeasy
    Matches
  - else
    Does not match

%p Only enable DKIM once you've set up your DNS records

= button_to (@app.dkim_enabled ? "Disable DKIM" : "Enable DKIM"), toggle_dkim_app_path(@app), class: "btn btn-primary"

%h1 Set up DKIM

%h2 Setting up your DNS
%p You will need to add two TXT records to your DNS.
%p
  Note that the format of the DNS values should work with #{link_to "DNS Made Easy", "http://www.dnsmadeeasy.com/"}.
  If you have a different DNS provider and discover that it does or does not work please
  #{link_to "file an issue on GitHub", "https://github.com/mlandauer/cuttlefish/issues/new"}.

%table.table
  %tr
    %th Name
    %th Value
  %tr
    %td _domainkey.#{@app.from_domain}
    %td t=y;o=~;
  %tr
    %td cuttlefish._domainkey.#{@app.from_domain}
    %td= @app.dkim_public_key_dns_dnsmadeeasy

%h3 Current value in DNS

- a = Net::DNS::Resolver.start("cuttlefish._domainkey.#{@app.from_domain}", Net::DNS::TXT).answer.first.txt
%p= a

%p
  - if a == @app.dkim_public_key_dns_dnsmadeeasy
    Matches
  - else
    Does not match

%p Only enable DKIM once you've set up your DNS records

= button_to (@app.dkim_enabled ? "Disable DKIM" : "Enable DKIM"), toggle_dkim_app_path(@app), class: "btn btn-primary"

Add a note about DNS providers
Add a note about DNS providers
