147
148
149
150
151
152
153
154
155
156
157
158
159
|
# File 'lib/pub.rb', line 147
def send_user_magic_link(email_or_phone, template_slug, redirect_url = '', life_time = 1440, max_visits = nil, driver = 'email')
data = {
driver: driver,
lifeTime: life_time,
maxVisits: max_visits,
redirectUrl: redirect_url,
templateId: template_slug
}
key = %w[sms whatsapp].include? driver ? 'phone' : 'email'
data[key] = email_or_phone
@client.raw('post', '/users/magic-link', nil, { data: data }.to_json, '/api/v1')
end
|