technical
DomainFlowController — Domain Set Up Skill Reference
File:Sodastream/Web/Web/Controllers/DomainFlowController.cs— DI: 26 services — Auth:[HasPermission]
Domain Creation Methods
| Method | Route | Permission | Description |
|---|---|---|---|
InitDomain(Id) | GET | AddNewDomain | Loads _InitDomain.cshtml modal. Populates SetupType, SendingMechanism dropdowns (GSuite/Outlook/Postal/Hmail), Instance dropdown (loaded per type), DomainType dropdown. Defaults: Type=Hmail, GoogleLoginId=3, InUse=true. |
InitDomain(domain) | POST | AddNewDomain | Saves domain to DB. Validates Name not empty. If SetupType=3, sets Type=null. Forces InUse=true. Calls AddOrUpdate. |
EditClientDomain(cd) | POST | AddEditCampaign | Creates Domain + CampaignDomain from client-owned flow. Validates: CampaignId, DomainPurchasedType, DomainName, RedirectUrl (must contain http), SetupType, OtherSendingMechanism if type=Other. Auto-assigns GoogleLoginId from first login of matching type. Sends SendDomainSubdomainNotification. |
EditCampaignDomainMultiple | GET/POST | AddEditCampaign | Bulk domain purchase. Validates each domain. Calls BuyDomain via GoDaddy API. Saves Domain + CampaignDomain. Sends PurchaseNewEmailDomain or PurchaseNonPurchasableNewEmailDomain notification per domain. |
SelectExistingDomain | GET/POST | AddEditCampaign | Copies existing domain from client's other campaigns to current campaign. Clones CampaignDomain with all fields. Calls AddWhitelistDomains. |
Init Processing
| Method | Description |
|---|---|
InitHangFireDomain(DomainId) (in DomainsController) | Enqueues Hangfire job _InitDomain. Inserts DomainRecords skeleton via InsertDomainRecordsSkeleton (only DomainName, DomainType, SendingMechanism, LastChecked). |
Hangfire Engine (_InitDomain)
| Step | Action | Condition |
|---|---|---|
| 1 | DNS Propagation Check (NS lookup) | Skipped if DomainType=Subdomain |
| 2 | Check GoDaddy | Always |
| 3a | GoDaddy infra (CNAME, DMARC, Redirect, BrandSSL) + Type setup | Domain on GoDaddy |
| 3b | SetupType-based path (CloudFlare/DNS-Records/SMTP/Route53) | Domain NOT on GoDaddy |
| 4 | Mark Initialised=true, Save log | Always |
Per-Type Setup Methods
| Type | Method | Key APIs |
|---|---|---|
| GSuite | GSuiteSetup() + AddToGoogleDomain() | GoDaddy + Google Admin SDK (InsertDomain, GetVerificationCode, Verify) |
| Outlook | OutlookSetup() | GoDaddy + Graph API (AddDomain, GetServiceConfig, Verify, GetDkimRecords, EnableDkim) |
| Postal | PostalSetup() | GoDaddy + Postal (AddDomain) |
| Hmail | HMailSetup() | GoDaddy + HMail (AddNewDomain) |
Set Complete
| Method | Description |
|---|---|
StupidMethod(id) (in DomainsController) | Finds campaign, sends DomainCompleted notification, calls AddDomainsToDomainRecords (full DNS: MX, SPF, DKIM, DMARC, CNAMEs), marks Completed=true + DomainStatus=OK. GSuite: also calls CheckDKIMRecord. |
Notification Methods
| Method | Enum | Trigger |
|---|---|---|
SendDomainSubdomainNotification | 153/180 | EditClientDomain POST |
PurchaseNewEmailDomain | 28 | Bulk purchase (purchasable) |
PurchaseNewNonPurchasableEmailDomain | 112 | Bulk purchase (non-purchasable) |
SendDomainDnsRecords | 163 | DNSRecord SetupType init |
SendDomainNameServers | 164 | SubdomainNsRecord SetupType init |
DomainCompleted | 61 | Set Complete (StupidMethod) |