Skip to content

add joinlink option to outgoing mail template#603

Merged
erdgeist merged 1 commit intofrab:masterfrom
elad-eyal:add_join_link
Oct 28, 2019
Merged

add joinlink option to outgoing mail template#603
erdgeist merged 1 commit intofrab:masterfrom
elad-eyal:add_join_link

Conversation

@elad-eyal
Copy link
Collaborator

@elad-eyal elad-eyal commented Oct 21, 2019

This PR adds the ability to add %{joinlink} to outgoing mail template, which will attach a URL to join the event as a speaker (or after #555 as assistant). So the accept email can include somthing like this:

Please ask your co-presenters to join the event by clickling this link: %{joinlink}

Additionally this PR changes the default behavior if the link cannot be generated (for %{link} and %{joinlink}). The existing code just leaves %{link}. The new code will substitute this for a hyphen, for example:

Please ask your co-presenters to join the event by clickling this link: -

In order for the links to work correctly for both production & dev, this PR adds a new Environment variable FRAB_PORT. Together with FRAB_PROTOCOL (which was not used) and FRAB_HOSTNAME, they are used for URL generation.

---

image

Sent mail to [email protected] (310.2ms)
Date: Mon, 21 Oct 2019 19:18:05 +0300
From: frab@localhost
Reply-To: [email protected]
To: [email protected]
Message-ID: <[email protected]>
Subject: Your submission to Spectre IX Conference
Mime-Version: 1.0
Content-Type: text/plain;
 charset=UTF-8
Content-Transfer-Encoding: 7bit
locale: en
title: Spectre IX Conference

Please ask your co-presenters to join the event by clicking this link: http://localhost:3000/en/spectre-ix/cfp/events/join/bWfgtzCA12LC193UhAXUSYww

image

@erdgeist
Copy link
Contributor

Even though this looks good to me, in my use case I wouldn't want to allow speakers to join after the event has been accepted. The amount and identities of speakers are what content curation teams base their acceptance on. So the join link shouldn't even work after CfP has ended which by it's nature is before bulk acceptance emails are sent ;)

But this, of course, might be handled differently at other conferences so I am not against it. However, once you're obviously expecting it to work that way, you might want to check if joining after CfP ended actually works for you.

This might also be a per-conference option:

Allow join:

  • Never
  • Until soft deadline
  • Until hard deadline
  • Until accepted

I kind of remember seeing something about this in issue #454.

@elad-eyal
Copy link
Collaborator Author

@erdgeist this PR is just about adding a way to send the request join link by e-mail. The code for allowing/rejecting a join is not affected. The link proposed here does not bypass these tests, it will still bring prospecting users to the "join this event" page.

Currently the join_as only allowed before hard deadline:

return redirect_to cfp_root_path, flash: { error: t('cfp.hard_deadline_over') }

test 'can not join an event after hard deadline' do

BTW- workaround - one can disable all the join links in a conference by running this in the rails console:

Conference.find_by(acronym: 'ripcord').events.update_all(invite_token: nil)

@erdgeist erdgeist merged commit 460e577 into frab:master Oct 28, 2019
@elad-eyal elad-eyal deleted the add_join_link branch December 20, 2019 06:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants