summaryrefslogblamecommitdiffstats
path: root/lib/registration.rb
blob: 5ace4383f8ae4f08c69cebf900daf6ab95db1d75 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14

                           











                                                                      
 
                                    
                         




                                                                  
   
require_relative 'band'
require_relative 'pdf_form'
require 'mail'

def send_registration_emails_for(band)
  mail = Mail.new
  mail.charset = 'UTF-8'
  mail.to = 'haraldei@anduin.net'
  mail.from = @band.contact.email
  mail.subject = "Registrering av band #{@band.name} til Norsk Urskog"
  mail.body = 'Neijassådu!'

  mail.deliver!
end

def generate_pdf_for(band, filename)
  pdf = PDFForm.new(band)
  pdf.render(filename)
end

def create_pdf_file_name(band)
  filename = "#{Date.today.iso8601}-#{band.name}-#{band.city}.pdf"
end