package mailimp

import (
	"github.com/tech/sendico/notification/interface/api/localizer"
	"github.com/tech/sendico/pkg/domainprovider"
)

type OneButtonTemplate struct {
	EmailNotificationTemplate
}

func (b *OneButtonTemplate) AddButtonText(text string) {
	b.AddData("ButtonText", text)
}

func (b *OneButtonTemplate) AddButtonLink(link string) {
	b.AddData("ButtonLink", link)
}

func (b *OneButtonTemplate) AddButton(text, link string) {
	b.AddButtonText(text)
	b.AddButtonLink(link)
}

func NewOneButton(l localizer.Localizer, dp domainprovider.DomainProvider) *OneButtonTemplate {
	p := &OneButtonTemplate{
		EmailNotificationTemplate: *NewEmailNotification(l, dp),
	}
	p.SetUnsubscribable(false)
	p.SetButton(true)

	return p
}
