| Line 452... |
Line 452... |
| 452 |
return botPenguin.send(WhatsappFlow.ADLD, mobile, Collections.singletonList(invoiceNumber),
|
452 |
return botPenguin.send(WhatsappFlow.ADLD, mobile, Collections.singletonList(invoiceNumber),
|
| 453 |
mediaUrl, fileName, WhatsappMessageType.DOCUMENT);
|
453 |
mediaUrl, fileName, WhatsappMessageType.DOCUMENT);
|
| 454 |
}
|
454 |
}
|
| 455 |
|
455 |
|
| 456 |
@Override
|
456 |
@Override
|
| - |
|
457 |
public boolean sendOfferRadar(String mobile, String regionSummary, int offersAdded,
|
| - |
|
458 |
int schemesAdded, int revisions, int endingSoon) throws Exception {
|
| - |
|
459 |
// No isProd guard here. Recipient scoping for this digest is handled
|
| - |
|
460 |
// upstream by OfferRadarNotificationController — the file holds the
|
| - |
|
461 |
// roster inline (a hardcoded test mobile during smoke-testing, or the
|
| - |
|
462 |
// full HO user list after the toggle is flipped for prod). That
|
| - |
|
463 |
// upstream toggle is the single audience gate; adding another
|
| - |
|
464 |
// env-scoped guard here would just make staging sends silently disappear.
|
| - |
|
465 |
// Meta rejects empty parameters, so an empty region string is normalised
|
| - |
|
466 |
// to "-" before it reaches the gateway. Counts render as decimal strings.
|
| - |
|
467 |
String safeRegion = (regionSummary == null || regionSummary.isEmpty()) ? "-" : regionSummary;
|
| - |
|
468 |
return botPenguin.send(WhatsappFlow.OFFER_RADAR, mobile,
|
| - |
|
469 |
Arrays.asList(
|
| - |
|
470 |
safeRegion,
|
| - |
|
471 |
Integer.toString(offersAdded),
|
| - |
|
472 |
Integer.toString(schemesAdded),
|
| - |
|
473 |
Integer.toString(revisions),
|
| - |
|
474 |
Integer.toString(endingSoon)),
|
| - |
|
475 |
null, null, null);
|
| - |
|
476 |
}
|
| - |
|
477 |
|
| - |
|
478 |
@Override
|
| 457 |
public boolean shouldSendWhatsappMessage(String mobile) {
|
479 |
public boolean shouldSendWhatsappMessage(String mobile) {
|
| 458 |
// Normalised rather than concatenated: BotPenguin stores the normalised MSISDN, so for anything
|
480 |
// Normalised rather than concatenated: BotPenguin stores the normalised MSISDN, so for anything
|
| 459 |
// that is not already a bare ten digits the old "91" + mobile key could never match a stored row
|
481 |
// that is not already a bare ten digits the old "91" + mobile key could never match a stored row
|
| 460 |
// and the throttle quietly never fired. Identical result for clean input.
|
482 |
// and the throttle quietly never fired. Identical result for clean input.
|
| 461 |
String destAddr = WhatsappNumbers.toMsisdn(mobile);
|
483 |
String destAddr = WhatsappNumbers.toMsisdn(mobile);
|