2026-01-25 18:47:22 +00:00
|
|
|
package text
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
2026-03-16 19:52:29 +00:00
|
|
|
"fmt"
|
2026-01-25 18:47:22 +00:00
|
|
|
|
2026-03-16 19:52:29 +00:00
|
|
|
"github.com/Gleipnir-Technology/bob"
|
|
|
|
|
"github.com/Gleipnir-Technology/nidus-sync/config"
|
|
|
|
|
"github.com/Gleipnir-Technology/nidus-sync/db/enums"
|
|
|
|
|
"github.com/Gleipnir-Technology/nidus-sync/platform/types"
|
2026-01-25 18:47:22 +00:00
|
|
|
)
|
|
|
|
|
|
2026-03-16 19:52:29 +00:00
|
|
|
func Job(ctx context.Context, txn bob.Executor, text_id int32) error {
|
|
|
|
|
return sendTextComplete(ctx, txn, text_id)
|
2026-01-25 18:47:22 +00:00
|
|
|
}
|
|
|
|
|
|
2026-03-16 19:52:29 +00:00
|
|
|
func ReportSubscriptionConfirmationText(ctx context.Context, destination types.E164, report_id string) error {
|
|
|
|
|
content := fmt.Sprintf("Thanks for submitting mosquito report %s. Text for any questions. We'll send you updates as we get them.", report_id)
|
|
|
|
|
origin := enums.CommsTextoriginWebsiteAction
|
|
|
|
|
err := sendTextBegin(ctx, *types.NewE164(&config.PhoneNumberReport), destination, content, origin, true, true)
|
2026-01-25 18:47:22 +00:00
|
|
|
if err != nil {
|
2026-03-16 19:52:29 +00:00
|
|
|
return fmt.Errorf("Failed to send initial confirmation: %w", err)
|
2026-01-25 18:47:22 +00:00
|
|
|
}
|
2026-03-16 19:52:29 +00:00
|
|
|
return err
|
2026-01-25 18:47:22 +00:00
|
|
|
}
|