-
Notifications
You must be signed in to change notification settings - Fork 83
Allow the issuer to select an SMS template #1352
Conversation
<select class="form-control" name="sms-template"> | ||
<option value="Default SMS template">Default SMS template</option> | ||
{{range $k, $v := $currentRealm.SMSTextAlternateTemplates}} | ||
<option value="{{$k}}">{{$k}}</option> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: indent
<select class="form-control" name="sms-template"> | ||
<option value="Default SMS template">Default SMS template</option> | ||
{{range $k, $v := $currentRealm.SMSTextAlternateTemplates}} | ||
<option value="{{$k}}">{{$k}}</option> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be {{$v}}
? If not, why is $v
scoped?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
templates can't do $k, _
and single var is just values. I need just the keys (labels)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but then can do $k := range
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but range $k := .someMap
iterates the map values, not the keys. Maybe I'm misunderstanding
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My b - apparently this is backwards in Go templates from the Go language /tableflip
pkg/api/api.go
Outdated
Phone string `json:"phone"` | ||
TZOffset float32 `json:"tzOffset"` | ||
Phone string `json:"phone"` | ||
SMSTemplateLabel string `json:"SMSTemplateLabel"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be smsTemplateLabel
(I don't make the rules)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea that's consistent with tzOffset. Weird though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
@whaught can do you do a followup to update the docs on the failure modes?
* `smsTemplateLabel` | ||
* If the realm has more than one SMS template defined, this may be optionally specify | ||
the label of the message template which the server should compose. If omitted, the | ||
default template will be used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if they supply a label that does not exist?
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sethvargo, whaught The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Issue #1320
Proposed Changes
Release Note