import { Section, Text } from '@react-email/components'; import * as React from 'react'; import { EmailLayout } from './components/email-layout'; import { EmailHeader } from './components/email-header'; import { EmailFooter } from './components/email-footer'; interface MqttCredentialsEmailProps { deviceName: string; deviceId: string; mqttUsername: string; mqttPassword: string; brokerUrl: string; brokerHost?: string; brokerPort?: string; } export const MqttCredentialsEmail = ({ deviceName = 'Device', deviceId = '10', mqttUsername = 'user_device10', mqttPassword = 'password123', brokerUrl = 'mqtt://localhost:1883', brokerHost = 'localhost', brokerPort = '1883', }: MqttCredentialsEmailProps) => { return (
Your MQTT credentials for device {deviceName} (ID: {deviceId}):
MQTT Broker: {brokerUrl} Host: {brokerHost} Port: {brokerPort} Username: {mqttUsername} Password: {mqttPassword} Topic Pattern: owntracks/owntrack/{deviceId}
OwnTracks App Setup: 1. Open OwnTracks app 2. Go to Settings → Connection 3. Set Mode to "MQTT" 4. Enter the credentials above: • Host: {brokerHost} • Port: {brokerPort} • Username: {mqttUsername} • Password: {mqttPassword} • Device ID: {deviceId} 5. Save settings 6. The app will connect automatically
⚠️ Keep these credentials secure. Do not share them with unauthorized persons. If you have any questions or need assistance, please contact your administrator. Best regards,
Location Tracker Team
); }; export default MqttCredentialsEmail; const content = { padding: '20px 40px', }; const paragraph = { color: '#374151', fontSize: '16px', lineHeight: '1.6', margin: '0 0 16px', }; const credentialsBox = { backgroundColor: '#f9fafb', border: '1px solid #e5e7eb', borderRadius: '6px', padding: '20px', margin: '20px 0', }; const credentialLabel = { color: '#6b7280', fontSize: '14px', fontWeight: '600', margin: '12px 0 4px', }; const credentialValue = { backgroundColor: '#ffffff', border: '1px solid #d1d5db', borderRadius: '4px', color: '#111827', fontSize: '14px', fontFamily: 'monospace', padding: '8px 12px', display: 'block', margin: '0 0 8px', }; const instructionsBox = { backgroundColor: '#eff6ff', border: '1px solid #bfdbfe', borderRadius: '6px', padding: '20px', margin: '20px 0', }; const instructionsTitle = { color: '#1e40af', fontSize: '16px', fontWeight: '600', margin: '0 0 12px', }; const instructionStep = { color: '#1e3a8a', fontSize: '14px', lineHeight: '1.8', margin: '4px 0', fontWeight: '500', }; const instructionDetail = { color: '#3730a3', fontSize: '13px', lineHeight: '1.6', margin: '2px 0', fontFamily: 'monospace', }; const warningText = { backgroundColor: '#fef3c7', border: '1px solid #fbbf24', borderRadius: '6px', color: '#92400e', fontSize: '14px', lineHeight: '1.6', margin: '20px 0', padding: '12px 16px', };