Add feedback link QR code to confirmation emails

This commit is contained in:
Petko Bordjukov 2019-10-12 20:56:16 +03:00
parent 3dfdbad313
commit 49b85190f2
5 changed files with 19 additions and 4 deletions

View File

@ -1,11 +1,10 @@
class Public::EventFeedbackQrcodesController < Public::ApplicationController class Public::EventFeedbackQrcodesController < Public::ApplicationController
def show def show
event = current_conference.events.joins(:proposition).approved.find(params[:event_id]) event = current_conference.events.joins(:proposition).approved.find(params[:event_id])
@qr = RQRCode::QRCode.new(new_event_feedback_url(event_id: event.id), level: :l)
respond_to do |format| respond_to do |format|
format.svg do format.svg do
render(inline: @qr.as_svg(shape_rendering: "crispEdges", module_size: 11, fill: "ffffff", offset: 10), render(inline: helpers.feedback_qr_code_as_svg(event.id),
filename: "feedback_qr_code_#{event.id}.svg") filename: "feedback_qr_code_#{event.id}.svg")
end end
end end

View File

@ -85,4 +85,12 @@ module ApplicationHelper
when 6 then t('ratings.excellent') when 6 then t('ratings.excellent')
end end
end end
def feedback_qr_code(event_id)
RQRCode::QRCode.new(new_event_feedback_url(event_id: event_id), level: :l)
end
def feedback_qr_code_as_svg(event_id)
feedback_qr_code(event_id).as_svg(shape_rendering: "crispEdges", module_size: 11, fill: "ffffff", offset: 10)
end
end end

View File

@ -2,7 +2,10 @@ class EventMailer < ActionMailer::Base
def confirmation_request(event) def confirmation_request(event)
@event = event @event = event
I18n.locale = @event.proposer.language I18n.locale = @event.proposer.language
attachments['feedback-link-qr-code.svg'] = {
mime_type: 'image/svg+xml',
content: helpers.feedback_qr_code_as_svg(@event.id)
}
mail to: @event.proposer.email, mail to: @event.proposer.email,
from: "program@openfest.org", from: "program@openfest.org",
subject: I18n.t("event_mailer.acceptance_notification.subject", subject: I18n.t("event_mailer.acceptance_notification.subject",

View File

@ -9,6 +9,9 @@
Моля, потвърдете участието си възможно най-скоро като кликнете на следния линк: Моля, потвърдете участието си възможно най-скоро като кликнете на следния линк:
<%= confirm_event_url @event, host: @event.conference.host_name, protocol: 'https' %> <%= confirm_event_url @event, host: @event.conference.host_name, protocol: 'https' %>
Моля, добавете прикаченият към този e-mail QR код в презентацията си. Той
съдържа връзка към формуляра за обратна връзка за предложеното от Вас събитие.
Моля пишете на ofvideo@openfest.org, ако имате специфични изисквания, например: Моля пишете на ofvideo@openfest.org, ако имате специфични изисквания, например:
* да ви осигурим лаптоп за презентация; * да ви осигурим лаптоп за презентация;

View File

@ -9,8 +9,10 @@ It has not been scheduled yet.
Please confirm your participation as soon as you can by following the following link: Please confirm your participation as soon as you can by following the following link:
<%= confirm_event_url @event, host: @event.conference.host_name, protocol: 'https' %> <%= confirm_event_url @event, host: @event.conference.host_name, protocol: 'https' %>
Please make sure you include the QR code attached to this email in your
presentation. It contains a link to the feedback form for your <%= @event.event_type.name.downcase %>.
Please email ofvideo@openfest.org if you hav any specific requirements, for example: Please email ofvideo@openfest.org if you have any specific requirements, for example:
* You need us to provide you with a laptop for your presentation; * You need us to provide you with a laptop for your presentation;
* You need to play sound for your presentation; * You need to play sound for your presentation;