Documentation ¶
Index ¶
- Constants
- type ServiceEngagement
- type ServiceEngagementImpl
- func (en *ServiceEngagementImpl) GenerateAndSendOTP(ctx context.Context, phone string, appID *string) (*profileutils.OtpResponse, error)
- func (en *ServiceEngagementImpl) ResolveDefaultNudgeByTitle(ctx context.Context, UID string, flavour feedlib.Flavour, nudgeTitle string) error
- func (en *ServiceEngagementImpl) SendMail(ctx context.Context, email string, message string, subject string) error
- func (en *ServiceEngagementImpl) SendRetryOTP(ctx context.Context, msisdn string, retryStep int, appID *string) (*profileutils.OtpResponse, error)
- func (en *ServiceEngagementImpl) SendSMS(ctx context.Context, phoneNumbers []string, message string) error
- func (en *ServiceEngagementImpl) VerifyEmailOTP(ctx context.Context, email, otp string) (bool, error)
- func (en *ServiceEngagementImpl) VerifyOTP(ctx context.Context, phone, otp string) (bool, error)
Constants ¶
View Source
const ( // SendRetryOtp ISC endpoint to send a retry OTP SendRetryOtp = "internal/send_retry_otp/" // SendOtp ISC endpoint to send OTP SendOtp = "internal/send_otp/" // VerifyEmailOtp ISC endpoint to verify email OTP VerifyEmailOtp = "internal/verify_email_otp/" // VerifyOTPEndPoint ISC endpoint to verify OTP VerifyOTPEndPoint = "internal/verify_otp/" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ServiceEngagement ¶
type ServiceEngagement interface { ResolveDefaultNudgeByTitle( ctx context.Context, UID string, flavour feedlib.Flavour, nudgeTitle string, ) error SendMail( ctx context.Context, email string, message string, subject string, ) error GenerateAndSendOTP( ctx context.Context, phone string, appID *string, ) (*profileutils.OtpResponse, error) SendRetryOTP( ctx context.Context, msisdn string, retryStep int, appID *string, ) (*profileutils.OtpResponse, error) VerifyOTP(ctx context.Context, phone, OTP string) (bool, error) VerifyEmailOTP(ctx context.Context, email, OTP string) (bool, error) SendSMS(ctx context.Context, phoneNumbers []string, message string) error }
ServiceEngagement represents engagement usecases
type ServiceEngagementImpl ¶
type ServiceEngagementImpl struct { Engage extension.ISCClientExtension // contains filtered or unexported fields }
ServiceEngagementImpl represents engagement usecases
func NewServiceEngagementImpl ¶
func NewServiceEngagementImpl( eng extension.ISCClientExtension, ext extension.BaseExtension, ) *ServiceEngagementImpl
NewServiceEngagementImpl returns new instance of ServiceEngagementImpl
func (*ServiceEngagementImpl) GenerateAndSendOTP ¶
func (en *ServiceEngagementImpl) GenerateAndSendOTP( ctx context.Context, phone string, appID *string, ) (*profileutils.OtpResponse, error)
GenerateAndSendOTP creates a new otp and sends it to the provided phone number.
func (*ServiceEngagementImpl) ResolveDefaultNudgeByTitle ¶
func (en *ServiceEngagementImpl) ResolveDefaultNudgeByTitle( ctx context.Context, UID string, flavour feedlib.Flavour, nudgeTitle string, ) error
ResolveDefaultNudgeByTitle calls the `engagement service` to resolve any default nudge by its `Title`
func (*ServiceEngagementImpl) SendMail ¶
func (en *ServiceEngagementImpl) SendMail( ctx context.Context, email string, message string, subject string, ) error
SendMail sends emails to communicate to our users
func (*ServiceEngagementImpl) SendRetryOTP ¶
func (en *ServiceEngagementImpl) SendRetryOTP( ctx context.Context, msisdn string, retryStep int, appID *string, ) (*profileutils.OtpResponse, error)
SendRetryOTP generates fallback OTPs when Africa is talking sms fails
func (*ServiceEngagementImpl) SendSMS ¶
func (en *ServiceEngagementImpl) SendSMS(ctx context.Context, phoneNumbers []string, message string) error
SendSMS does the actual delivery of messages to the provided phone numbers
func (*ServiceEngagementImpl) VerifyEmailOTP ¶
func (en *ServiceEngagementImpl) VerifyEmailOTP(ctx context.Context, email, otp string) (bool, error)
VerifyEmailOTP checks the otp provided matches the one sent to the user via email address
Click to show internal directories.
Click to hide internal directories.